Question: 1) [5 pts] Build a simple calculator using switch statements which can perform the four operations +, -, *,/. Write a program that asks the

 1) [5 pts] Build a simple calculator using switch statements which

1) [5 pts] Build a simple calculator using switch statements which can perform the four operations +, -, *,/. Write a program that asks the user to enter two numbers/operands. Then prompt the user to enter the operator +,, ). Perform the corresponding operation and display the answer to user. The format Example of multiplication Microsoft Visual Studio Debug Console an operator (+, -, *, ): Enter two operands: 25.5 2.314 25.5 2.314597 2) [5 pts] Create a program to prompt the user to enter the number of candy bars he or she would like to buy. The input will be a number. Use the switch/case structure to determine the bill, where 1 bar $0.75 2bars- $1.25 3 bars $1.65 more than 3 bars 1.65$0.30 (number ordered -3) Hint: Use iflelse statement to check if the user enters a positive number for number of bars Otherwise display an error message. Microsoft Visual Studio Debug Console nter number of bars: 5 of 5 bars is $2.25

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!