Caroline needs to keep track of job and revenue information. You will write a program to
enable this to happen.
The program will sort and search the file paintingJobs.txt to select and display
information about estimates and jobs.
The paintingJobs.txt file shows Estimate Number, Estimate Date, Customer ID,
Final Total (in £ pounds), Status (E for Estimate, A for Accepted job or N for Not accepted),
and Amount Paid (in £ pounds). A copy of this file is shown in Appendix A.
Requirements
• Display four options for the user to select from.
Option A Search for an estimate
Option B Display outstanding payments
Option C Display total revenue
Enter Q to quit
• The user must be able to select an option or enter ‘Q’ to quit the program.
• All data must be read from the paintingJobs.txt file.
• The program must work for all of the records in the paintingJobs.txt file.
Option A must provide a prompt for the user to enter the estimate number.
• It must find the customer ID and estimate details for the entered estimate number.
• Here is a suggested format for displaying the data.
Estimate Number: <the estimate number>
Customer ID: <the customer ID>
Estimate Amount: <the final total>
Estimate Date: <the estimate date>
Status: <the status>
9
W48968A
Turn over
Option B must show all jobs with outstanding payments. This only applies to estimates
with a status of A (Accepted). Payments are outstanding if the amount paid is less than
the final total.
• It must only show outstanding payments for jobs with a status of ‘A’.
• It must calculate and display the total of the outstanding payments.
• Here is a suggested format for displaying the data.
Estimate Number Customer ID Final Total Amount Paid Amount Outstanding
Estimate Number Customer ID Final Total Amount Paid Amount Outstanding
Estimate Number Customer ID Final Total Amount Paid Amount Outstanding
Total Outstanding: Total Outstanding
Option C must calculate the total revenue for jobs that have been accepted and
fully paid.
• The calculation must only include jobs with a status of ‘A’.
• The calculation must only include jobs that have been fully paid.
• Here is a suggested format for displaying the data.
Total Revenue
The company’s total revenue so far is <the total revenue>