Code the algorithm shown in Figure 6-41. Use the switch statement to code the multiple-alternative selection structure.

Question:

Code the algorithm shown in Figure 6-41. Use the switch statement to code the multiple-alternative selection structure. If necessary, create a new project named TryThis11 Project, and save it in the Cpp8\Chap06 folder. Enter the C++ instructions into a source file named TryThis11.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Save and run the program. Test the program using the following codes: 1, 2, 3, and 7.

Figure 6-41

IPO chart information C++ instructions Input department code (1, 2, or 3) int deptCode 0; Processing none Output salary int salary = 0; Algorithm: 1. enter the department code 2. íf (the department code is one of the following:) salary = 25000 salary = 30000 salary = 32000 display

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: