1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
A-1-3-001) DECLARE local int array hoursParkedByCustomer with c_customerCount elements
A-1-3-002) DECLARE local int customerNumber
A-1-3-003) DECLARE local double totalParkingReceipts with an initial value of zero
A-1-3-004) DECLARE local double parkingCharge
A-1-3-005) DECLARE local Boolean usedMaximumParkingCharge with an initial value of false
A-1-3-006) DECLARE local Boolean usedMinimumParkingCharge with an initial value of false
A-1-3-007) CALL private member function getDailyParkingActivity, passing it the following argument: hoursParkedByCustomer
A-1-3-008) DISPLAY line 4 of Exhibit Z, proceeded by 2 newlines and followed by 1 newline
A-1-3-009) CALL private member function displayColumnHeadings
REPETITION HEADER:
A-1-3-010) FOR each customer starting from first through last customer, followed by opening brace for body of loop
A-1-3-011) ASSIGN value returned by CALLing private member function calculateCustomerParkingCharge with the following arguments:
A-1-3-012) (hoursParkedByCustomer[customerNumber-1]
A-1-3-013) usedMaximumParkingCharge
A-1-3-014) usedMinimumParkingCharge)
A-1-3-015) TO parkingCharge
A-1-3-016) SUMMARIZE current value of parkingCharge INTO totalParkingReceipts
A-1-3-017) CALL private member function displayThisCustomer with the following arguments:
A-1-3-018) (customerNumber
A-1-3-019) hoursParkedByCustomer[customerNumber-1]
A-1-3-020) parkingCharge
A-1-3-021) usedMaximumParkingCharge
A-1-3-022) usedMinimumParkingCharge
REPETITION FOOTER:
A-1-3-023) Enter closing brace for body of loop
A-1-3-024) CALL private member function displayReportSummaryLine with the following arguments:
totalParkingReceipts and "Total Receipts"
A-1-3-025) CALL private member function displayReportSummaryLine with the following arguments:
A-1-3-026) totalParkingReceipts/getCustomerCount() and "Average Fee"
A-1-3-027) DECLARE local constant double variable named c_minimumParkingCharge with a value of 2.0
A-1-3-028) DECLARE local constant double variable named c_maximumParkingCharge with a value of 10.0
A-1-3-029) DECLARE local constant double variable named c_maximumParkingHoursForMinimumParkingCharge with a value of 3.0
A-1-3-030) DECLARE local constant double variable named c_chargePerHourAfterMinimum with a value of 0.5
A-1-3-031) DECLARE local double variable named parkingCharge with a value of c_minimumParkingCharge
SINGLE-ALTERNATIVE IF statement (no braces required around conditional assignment statement)
A-1-3-032) If (hours parked exceeds hours parked for minimum charge)
A-1-3-033) ASSIGN value of expression (c_minimumParkingCharge PLUS c_chargePerHourAfterMinimum
A-1-3-034) MULTIPLIED BY the expression ceil(hoursParked
A-1-3-035) MINUS c_maximumParkingHoursForMinimumParkingCharge))
A-1-3-036) TO parkingCharge
DOUBLE-ALTERNATIVE IF statement (braces required around compound-true alternative statements, but not around false alternative statement)
A-1-3-037) if (parking charge exceeds maximum allowed parking charge)
A-1-3-038) ASSIGN value of true TO usedMaximumParkingCharge
A-1-3-039) ASSIGN value of c_maximumParkingCharge TO parkingCharge
A-1-3-040) ELSE
A-1-3-041) ASSIGN value of false TO usedMaximumParkingCharge
DOUBLE ALTERNATIVE IF statement (no braces required around either true or false conditional statement)
A-1-3-042) if (parking charge is the same as minimum parking charge)
A-1-3-043) ASSIGN value of true TO usedMinimumParkingCharge
A-1-3-044) ELSE
A-1-3-045) ASSIGN value of false TO usedMinimumParkingCharge
A-1-3-046) RETURN parkingCharge
A-1-3-047) DISPLAY newline, followed by tab, followed by RIGHT JUSTIFICATION, followed by
A-1-3-048) appropriate width for, followed by first line of customer-number heading column, followed by
A-1-3-049) appropriate width for blank space between columns, followed by literal string for 1 blank, followed by
A-1-3-050) appropriate width for, followed by first line of hours-parked heading column, followed by
A-1-3-051) appropriate width for blank space between columns, followed by literal string for 1 blank, followed by
A-1-3-052) appropriate width for, followed by first line of parking-fee heading column, followed by
A-1-3-053) appropriate width for blank space between columns, followed by literal string for 1 blank, followed by
A-1-3-054) appropriate width for, followed by first line of default-charge heading column
A-1-3-055) DISPLAY new line, followed by tab, followed by RIGHT JUSTIFICATION, followed by
A-1-3-056) appropriate width for, followed by second line of customer-number heading column, followed by
A-1-3-057) appropriate width for blank space between columns, followed by literal string for 1 blank, followed by
A-1-3-058) appropriate width for, followed by second line of hours-parked heading column, followed by
A-1-3-059) appropriate width for blank space between columns, followed by literal string for 1 blank, followed by
A-1-3-060) appropriate width for, followed by second line of parking-fee heading column, followed by
A-1-3-061) appropriate width for blank space between columns, followed by literal string for 1 blank, followed by
A-1-3-062) appropriate width for, followed by second line of default-charge heading column
A-1-3-063) followed by newline
A-1-3-064) DECLARE local constant int variable named c_reportSummaryRightIndentWidth with a value of the following expression
A-1-3-065) getCustomerColumnWidth()
A-1-3-066) PLUS getHoursParkedColumnWidth()
A-1-3-067) PLUS 2 MULIPLIED BY getInterColumnWidth()
A-1-3-068) MINUS reportSummaryLabel.length()
A-1-3-069) DISPLAY 2 newlines, followed by tab, followed by RIGHT JUSTIFICATION
A-1-3-070) reportSummaryLabel
A-1-3-071) format manipulators for currency display, followed by
A-1-3-072) appropriate width for report-summary right indent, followed by literal string for 1 blank, followed by
A-1-3-073) appropriate width for parking-charge column, followed by reportSummaryAmount
|