# SOLVED CS441 Assignment 1 Solution and Discussion

• ``````Assignment No.  1
``````

Semester: Spring 2020
CS441 – Big Data Concepts
Total Marks: 20
Due Date: 01/06/2020
Lectures covered:
Week 1 to week 3

Instructions
It should be clear that your assignment will not get any credit if:

o Assignment is submitted after due date.
o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From internet/students).

Software allowed to develop Assignment

• Python editor

Objectives:
To enable students to write, execute a program in Python. Moreover to familiarize students with the concepts of:
• Variables and operators
• Conditional statements
• Loop structures

Assignment Submission Instructions
You have to submit only.py file on the Assignments interface of CS441 on VULMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.

Assignment

Write a program in Pyton programming language, which allows the user to input an integer value for a variable named upperLimit. Based on the input value, the program should perform the following tasks:

• Check whether the value entered by the user falls within the range from 1 to 100. (1 and 100 included in the given range.)
• Calculate and display the sum of all numbers within the range (1 to upperLimit).
• Calculate and display the average of all numbers within the range (1 to upperLimit).
• Calculate and display the total number of numbers within the range (1 to upperLimit).

Sample output for the wrong input:

Sample output for the wrong input:

Sample output for the correct input:

The deadline to submit your assignment solution is 01/06/2020. Your assignment must be submitted within the due date through VULMS. No assignment will be accepted through email after the due date.

• Assignment No. 1
Semester: Spring 2020
CS441 – Big Data Concepts
Total Marks: 20
Due Date: 01/06/2020
Lectures covered:
Week 1 to week 3

Instructions
It should be clear that your assignment will not get any credit if:

o Assignment is submitted after due date.
o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From internet/students).

Software allowed to develop Assignment

• Python editor

Objectives:
To enable students to write, execute a program in Python. Moreover to familiarize students with the concepts of:
• Variables and operators
• Conditional statements
• Loop structures

Assignment Submission Instructions
You have to submit only.py file on the Assignments interface of CS441 on VULMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.

Assignment

Write a program in Pyton programming language, which allows the user to input an integer value for a variable named upperLimit. Based on the input value, the program should perform the following tasks:

• Check whether the value entered by the user falls within the range from 1 to 100. (1 and 100 included in the given range.)
• Calculate and display the sum of all numbers within the range (1 to upperLimit).
• Calculate and display the average of all numbers within the range (1 to upperLimit).
• Calculate and display the total number of numbers within the range (1 to upperLimit).

Sample output for the wrong input:

Sample output for the wrong input:

Sample output for the correct input:

The deadline to submit your assignment solution is 01/06/2020. Your assignment must be submitted within the due date through VULMS. No assignment will be accepted through email after the due date.

Solution Code:

``````start=1
sum=0.0
average=0.0
count=0

print("Enter the upper Limit:")
upperLimit=input()

if upperLimit<=1:
print("Wrong input!! Upper Limit should not be less than 1")
elif upperLimit>100:
print("Wrong input!! Upper Limit should not be greter than 100")
else:
print
for num in range(start, upperLimit+1):
sum=sum+num
count=count+1

print("Sum of all numbers within the range:")
print(sum)
print
average= sum/count
print("Average of all the numbers within the range:")
print(average)
print
print("Total number of numbers within the range:")
print(count)

``````

• Assignment No. 1
Semester: Spring 2020
CS441 – Big Data Concepts
Total Marks: 20
Due Date: 01/06/2020
Lectures covered:
Week 1 to week 3

Instructions
It should be clear that your assignment will not get any credit if:

o Assignment is submitted after due date.
o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From internet/students).

Software allowed to develop Assignment

• Python editor

Objectives:
To enable students to write, execute a program in Python. Moreover to familiarize students with the concepts of:
• Variables and operators
• Conditional statements
• Loop structures

Assignment Submission Instructions
You have to submit only.py file on the Assignments interface of CS441 on VULMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.

Assignment

Write a program in Pyton programming language, which allows the user to input an integer value for a variable named upperLimit. Based on the input value, the program should perform the following tasks:

• Check whether the value entered by the user falls within the range from 1 to 100. (1 and 100 included in the given range.)
• Calculate and display the sum of all numbers within the range (1 to upperLimit).
• Calculate and display the average of all numbers within the range (1 to upperLimit).
• Calculate and display the total number of numbers within the range (1 to upperLimit).

Sample output for the wrong input:

Sample output for the wrong input:

Sample output for the correct input:

The deadline to submit your assignment solution is 01/06/2020. Your assignment must be submitted within the due date through VULMS. No assignment will be accepted through email after the due date.

Solution Code:

``````start=1
sum=0.0
average=0.0
count=0

print("Enter the upper Limit:")
upperLimit=input()

if upperLimit<=1:
print("Wrong input!! Upper Limit should not be less than 1")
elif upperLimit>100:
print("Wrong input!! Upper Limit should not be greter than 100")
else:
print
for num in range(start, upperLimit+1):
sum=sum+num
count=count+1

print("Sum of all numbers within the range:")
print(sum)
print
average= sum/count
print("Average of all the numbers within the range:")
print(average)
print
print("Total number of numbers within the range:")
print(count)

``````

5

2

2

2

7

2

4

1
| |