Question: Question 2 (a) Part of program development is the visualization of the program using a flow chart. Draw (describe) the flow chart for the follow
Question 2 (a) Part of program development is the visualization of the program using a flow chart. Draw (describe) the flow chart for the follow program(s): (i) Obtain Num1 and Num2 from the user If Num is less than 25: Sum = Sum + Num1 Else: Sum = Sum - Num2 Display Sum to the user (Assume Num1, Num2, and Sum are integers) (5 marks) (ii) Obtain X, Y, and Z from the user Calculate the Total = X+Y+Z Calculate the Average =T/3 Calculate the Product = X Y Z Display the Total, Average, and Product to the user (assume X, Y, Z, Total, Average, and Product are floats) (5 marks) The volume of a sphere can be determined by the following formula: V = 3 where V is the volume of the sphere in cubic meter It is the dimensionless number 3.1416 r is the radius of the sphere in meters (b) Write a program that prompts the user for the radius (in cm) and the value of Tt, and displays the volume in cubic meters. Ensure that the user inputs the values with correct units. Hint: convert the radius from cm to meters first. (10 marks) (Total: 20 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
