Wk05_Switch_Nested_Selection_ASSIGNMENT

Wk05_Switch_Nested_Selection_ASSIGNMENT - COMP100...

This preview shows pages 1–2. Sign up to view the full content.

COMP100 Programming Fundamentals Week 5 Exercise using the switch statement Question 1-5 is due at the beginning of next class (just demonstration) 1. Write a program that prompts the user for a menu choice. The program will display a message based on the following table: Choice Message 1 "Calculate area" 2 "Calculate volume" 3 "Calculate surface area" 0 "Exit the program" << any other input>> "ERROR: Invalid choice " 2. Write a program that allows the user to enter two integers and a character If the character is A, add the two integers If it is S, subtract the second integer from the first if it is M, multiply the integers Display the results of the arithmetic 3. Write a program that prompts the user for the number of courses and residency status (domestic or international) and calculates tuition cost. Cost is based on the table below. Domestic \$325 per course International \$1375 per course You decide how you want the user to enter her/his residency status and prompt accordingly, also you should use named constants for the cost per course 4. Write a program that prompts the user for a day of the week. The program will display a message based on the following table: Choice Message Sun "Home" Mon "Work" Tue "Work" Wed "Home" Thu "Work" Fri "Work" Sat "Work" 5. Write a program for a furniture company. Ask the user to choose Pine Oak or Mahogany. Show the

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern