Computer Programming Group_Assignment
Computer Programming Group_Assignment
General Instruction:
Question 1: Write a complete C++ program starting from the #include<iostream> header that
displays the following menu on the screen and performs all the tasks listed below: [20 pts]
Simple Calculator
========================
========================
• If the user enters 1, the program should ask for the radius of the sphere and then display
its volume. Use 3.14159 for PI.
Question 2: Write a complete C++ Program using while loop that asks the user to enter any number
‘N’ from the keyboard to finds the reverse of the number and add 10 to the number and then
display the result on the screen.
for example, if the input is 125, the output should be 531, that is 521+10 and if the input is 34,
the output should be 53, that is 43+10. [5 pts]
Question 3: Write a complete C++ program using for loop that asks the user to enter a number
‘N’, from the keyboard and then prints all even squares between 1 and 2n. [5 pts]
for example, if the user enters 40, the program should print the following:
16
36
64
Q 4: What is the difference between inline functions and normal functions? write an interactive
program with an inline function for finding the maximum value of two numbers. [3 pts]
Q 5: What is infinite loop mean? Write at most 3 examples of infinite loops using for loop. [4 pts]
Q 6: What are arrays? Explain how they simplify programming with a suitable example?. [3 pts]