Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that the Traffic Department can use when the owner of a car pays all his outstanding road fines. The Traffic Department

image text in transcribed
Write a C++ program that the Traffic Department can use when the owner of a car pays all his outstanding road fines. The Traffic Department has a file called Fines.dat that keeps the registration number and the road fine due for each traffic offence, one per line Your program should request the registration number from the user, read the contents of file Fines.dat (shown below) line by line; if the road fine matches the registration number, display the fine and calculate the total amount due for that registration number. At the same time all the remaining registration numbers and road fines should be written to a new file called OutStandingFines.dat Run your program to calculate the road fines owed by a car with registration number ABC123 Fines.dat ABC123 400 DEC234 340 ABC123 500 GED345 600 ABC123 240 GEE600 120 GED345 230 GEE600 470 ABC123 120 NB: You should not count the number of lines in the file to determine how many times the file should be accessed Sample output: Please enter registration number ABC123 Fines R400.00 R500.00 R240.00 R120.00 Total fine due R1260.0 Process returned 0 (0x0) execution time: 4.309 s Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions

Question

What is a business plan?

Answered: 1 week ago

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago

Question

3. Are our bosses always right? If not, what should we do?

Answered: 1 week ago