This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Program 3: Same as Program 2, except that a switch…case statement is used to select and output the appropriate letter grade for each student based on the work performed, instead of nested if…else statements as in part B. Suggestion: your switch variable can be 1/10 of your grade, thus, a case statement might look like this: case 8: cout << “B”; break; The default: statement of the switch can be used to allocate F’s. Lab Assignment 3 Examples • Program 1. Please enter integers a and b: 22 7 After executing c = a++ + ++b; a = 23; b = 8; and c = 30. c == a + b is false. • Programs 2 and 3 (code is different, output is same). Please enter student’s semester and final exam grades: 95 76 Student’s numeric and letter grades are 91.2 and A....
View Full Document
- Spring '11