Question: Goal: Use selection and repetition to write a program which uses functions Problem Statement - A program is required which will act as a calculator.

 Goal: Use selection and repetition to write a program which uses

Goal: Use selection and repetition to write a program which uses functions Problem Statement - A program is required which will act as a calculator. The program should prompt the user to enter 2 integers and a code. The program should perform the following actions based on the code entered . A code of 1 indicates that the two numbers should be added . A code of 2 indicates that the two numbers should be multiplied A code of 3 indicates that the first number should be divided by the second number A code of 4 indicates that the first number should be subtracted from the second . umber. The program should then print both numbers, with appropriate labels as well as the sum difference, product or quotient with an appropriate label indicating what is being printed. This process should be repeated until 2 zeros are entered. An appropriate message should then be printed to notify the user of thee Sample Output Please enter a number3 Please enter another number 6 Please enter the code 1 The first number is 3 and second number is 6. The sum of these numbers is 9 Please enter a number4 Please enter another number 5 Please enter the code 2 The first number is 4 and the second number is 5. The product of these numbers is 20 Please enter a number 0 Please enter another number 0

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!