Electrical and Computer Engineering
27 of 30
UAH
CPE 112
Case Study: Implementation
•// Postcondition:
•//     IF input of deptID failed due to end-of-file
•//          deptID and deptSales are undefined
•//     ELSE
•//          The data file reading marker has advanced
•//          past one department's data
•//       && deptID == department ID number as read from
•//          the file
•//       && deptSales == sum of the sales values for
•//          the department
•
•{
•    int   numDays;  // Number of business days in the month
•    int   day;      // Loop control variable for daily sales
•    float sale;     // One day's sales for the department