Home | | Schedule | | Assignments | | Lectures | | Resources
If and Switch Statements
Question 1 Why was the statement cout << " , but marginal";not executed?
In order for the statement but marginal to be executed, the students average must be less than 70.0 Since the average for the given scores was 75, the statement was not executed.
Question 2 Why does the program not give the correct output?
The program gives incorrect output because there were no break statements used following case 0 case 8 and case 9 Since no break statements were used, the output for all of the cases was given instead of just the correct one.
CSCI 131: Techniques of Programming
Last Modified: February 10, 2014
Page Expires: February 10, 2015