This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Finally, the two additions are performed left to right: 17 + 0 + 1500 = 1517 b. Execution of inClassAvg = labPts / labMax * 100; Division and multiplication have the same precedence so evaluation is left to right. All operands are integers so integer division is used. Hence the evaluation is as follows: inClassAvg = (23 / 25) * 100 = 0 * 100 = 0 c. Execution of labGrade = OUT_WEIGHT * outClassAvg + IN_WEIGHT * inClassAvg; is as follows: labGrade = (0.4 * 1517) + (0.6 * 0) = 606 + 0 = 606.8 Question 3: Corrected Program...
View Full Document
This note was uploaded on 03/22/2010 for the course CS 202 taught by Professor Fong during the Spring '10 term at SIU Carbondale.
- Spring '10
- Computer Science