Your customer needs an automated system to patrol the highways. The job of the system is to collect the following information on vehicles traveling down a certain stretch of highway: license plate number, current speed, and speed limit. A program is required to determine if a speeding ticket is needed for each set of data. Ticket will only be issued when number of miles per hours (mph) over the speed limit is at least 5 mph. Ticket prices are calculated as follow: base + fee * . The base is always $150 and the fee per mph over the speed limit is varied according to number of mph over the speed limit. The fee per mph over the speed limit is $5 when number of mph over the speed limit is no more than 20 mph. However, the fee per mph over the speed limit is $10 when number of mph over the speed limit is between 20 mph and 50 mph. In addition, a ticket of $1000 is automatically given to vehicle when number of mph over the speed limit is more than 50 mph. You can assume that valid data will be provided, and your program must allow the processing to be repeated until a sentinel value of “QUIT” is entered. It must display percent of ticketed vehicles and average ticket amount. Follow the user-interface as shown below including 2 digits after the decimal point. You must run the following test cases as one run. [Provide some useful information about AHP program including your name, version, and instructions, etc.] Enter a license plate number --> ABC123 Enter current vehicle’s speed --> 60 Enter speed limit in the zone --> 55 Vehicle travelled 5 miles over the speed limit. A ticket of $175 is issued to ABC123. Enter a license plate number --> 123XYZ Enter current vehicle’s speed --> 59 Enter speed limit in the zone --> 55 Vehicle travelled 4 miles under the speed limit. No ticket is issued to 123XYZ. Enter a license plate number --> FASTONE Enter current vehicle’s speed --> 80 Enter speed limit in the zone --> 50 Vehicle travelled 30 miles over the speed limit. A ticket of $450 is issued to FASTONE. Enter a license plate number --> QUIT Tickets were given to 2 out of 3 vehicles. Percent of ticketed vehicles: 66.67% Average ticket amount: 312.50 Thank you for using our AHP program. Additional Requirements: You must utilize modules/functions in your program. There must be at least 4 modules/functions: program information, input data, calculation, and display results. DO NOT use global variables in your program. Start with the design by identifying the modules/functions, drawing the hierarchy chart, and coming up with the pseudocode for each module/function before attempting your code on the computer. Be sure the follow the user-interface as specified.
Your customer needs an automated system to patrol the highways. The job of the system is to collect the following information on vehicles traveling down a certain stretch of highway: license plate number, current speed, and speed limit. A
You can assume that valid data will be provided, and your program must allow the processing to be repeated until a sentinel value of “QUIT” is entered. It must display percent of ticketed vehicles and average ticket amount. Follow the user-interface as shown below including 2 digits after the decimal point. You must run the following test cases as one run.
[Provide some useful information about AHP program
including your name, version, and instructions, etc.]
Enter a license plate number --> ABC123<Enter>
Enter current vehicle’s speed --> 60<Enter>
Enter speed limit in the zone --> 55<Enter>
Vehicle travelled 5 miles over the speed limit.
A ticket of $175 is issued to ABC123.
Enter a license plate number --> 123XYZ<Enter>
Enter current vehicle’s speed --> 59<Enter>
Enter speed limit in the zone --> 55<Enter>
Vehicle travelled 4 miles under the speed limit.
No ticket is issued to 123XYZ.
Enter a license plate number --> FASTONE<Enter>
Enter current vehicle’s speed --> 80<Enter>
Enter speed limit in the zone --> 50<Enter>
Vehicle travelled 30 miles over the speed limit.
A ticket of $450 is issued to FASTONE.
Enter a license plate number --> QUIT<Enter>
Tickets were given to 2 out of 3 vehicles.
Percent of ticketed vehicles: 66.67%
Average ticket amount: 312.50
Thank you for using our AHP program.
Additional Requirements: You must utilize modules/functions in your program. There must be at least 4 modules/functions: program information, input data, calculation, and display results. DO NOT use global variables in your program. Start with the design by identifying the modules/functions, drawing the hierarchy chart, and coming up with the pseudocode for each module/function before attempting your code on the computer. Be sure the follow the user-interface as specified.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images