Lab 7 switch statements
Don't forget your error checking! Your program output should display all possible
outcomes for your program.
Lab 7-1 switch with character (10 points)
- Project Name: yourname7_1
- cpp filename: yourname7_1.cpp
- Create pseudocode for this program
- Create a program that asks the user to input a letter indicating their year
in high school
- For example, the choices might be F, O, J, S for Freshman, Sophomore, Junior,
Senior
- Use the switch statement to ouput a different message for each grade level
and to indicate how many years of high school the student has left
Lab 7-2 switch with integer (10 points)
- Project Name: yourname7_2
- cpp filename: yourname7_2.cpp
- Create pseudocode for this program
- Use the switch statement for this program
- Create a program that lets the user choose between four integers (1, 2,
3, 4)
- If the user chooses 1, ask them to input their age
- If the user chooses 2, ask them to input the number of states in the U.S.
- If the user chooses 3, ask them to input the number of sodas they drank
yesterday
- If the user chooses 4, ask them to input the number of continents
- Output a message that displays the user's input back to the screen
Lab 7 Enrichment
Text Programming Problems:
p. 201 # 7, #10, #1, #12
Terminating a program with the assert function (pp. 186-188)