This preview shows pages 1–2. Sign up to view the full content.
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 switchcase statement is used to select and output the appropriate letter grade for each student based on the work performed, instead of nested ifelse 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 Fs. 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 students semester and final exam grades: 95 76 Students numeric and letter grades are 91.2 and A....
View Full Document
This note was uploaded on 06/28/2011 for the course CS 171 taught by Professor Ravi during the Spring '11 term at Minnesota.
- Spring '11