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
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 "Invalid code" salary = 1. 3 4 end if 3. display salaryy
Step by Step Solution
3.58 Rating (166 Votes )
There are 3 Steps involved in it
TryThis11cpp displays the salary associated with a department code Createdrevised by on include usin... View full answer
Get step-by-step solutions from verified subject matter experts
