Recitation Week 3 – Basic Input & Arithmetic solution

$9.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (4 votes)

Problem 1. (10 points)
Ask the user to enter a string and print out the string they entered.
Sample program output:
Please enter a string:
Hello
You entered: Hello
Problem 2. (15 Points)
Ask the user to enter three numbers and output the sum, product and average of the numbers.
Sample program output:
Please enter three numbers:
1
20
6
The sum is: 27
The product is: 120
The average is: 9.0
Problem 3. (20 Points)
Ask the user to enter the number of seconds and convert it into hours minutes and seconds.
Sample program output:
Please enter seconds:
3665
You entered: 1 hour(s), 1 minute(s) and 5 second(s)
Problem 4. (20 Points)
Ask the user to enter two numbers. Store these in two variables and then swap the values before
displaying them
Sample program output:
Please enter two numbers:
10
20
Swapped values are 20 and 10
NOTE: DO NOT just print them in opposite order. The values have to be swapped in the variables used
to store them
For example if you stored the first number in a variable var1 and the second in var2 at the end of your
code the number which was originally in var1 should now be in var2 and the number which was
originally in var2 should now be in var1