Homework
Problem
1:
Input 3 test scores T1, T2, and T3 for a student. The final
grade is found by
0.30 *T1 +
0.30 * T2 + 0.40 * T3.
The program
should output ‘pass’ if final grade is greater than or equal to 70;
‘fail’ if final grade is less than 50 and ‘probation’ otherwise.
•
Problem
2: Calculate
the volume of a sphere using the formula: (Use 3.1416 for Π, read r
from user)
4
V = ---
Π r3
3
•Problem
3: Read in two
integer numbers and store them in Num1
and Num2.
Write a program to interchange the values contained in the memory
locations Num1
and Num2,
and print out the results.
–Input:
3
5
–Output:
Num1 is 3
N
Num2 is 5
Interchange
is OK!
Num1 is 5
and Num2 is 3.
Problem
1: Assuming
that M and N are integer variables with the values -5 and 8, respectively,
and that X, Y, and Z are real variables with values -3.56, 0, and 44.7,
respectively. Find the values of te following logical
expressions: