Question: C++ Question 2 (a) Part of program development is the visualization of the program using a flow chart. Draw (describe the flow chart for the

C++

C++ Question 2 (a) Part of program development is the visualization of

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 Num1 is less than 25: Sum = Sum + Num 1 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 X Y Z Display the Total, Average, and Product to the user (assume X, Y, Z, Total, Average, and Product are floats) (5 marks) (b) The volume of a sphere can be determined by the following formula: V = ar3 4 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 Write a program that prompts the user for the radius (in cm) and the value of it, 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!