C Billing Report


A bus line called the World's Longest Street Bus Line, wants you to write a program that produces a billing report based on passenger trips and cost of trips. The company has a large fleet of buses that run between towns, on different parts of Yonge Street from Toronto to Barrie. Yonge Street is over 700 miles long and is the longest street in the world. The buses can stop at many towns between Toronto and Barrie.

These buses are equipped with the latest satellite technology that can tell where all buses are located. In order for a passenger to use the bus they need a credit card. When the passenger gets on the bus they slide their credit card into a machine. The machine reads the credit card number and sends a message containing the credit card number and the location where the passenger got onto the bus to the satellite. The satellite then sends the message to the head office of the bus line. When the passenger gets off the bus, they insert their credit card again and the same process occurs.

The program will read two files: [url removed, login to view] (containing data about prices and cities), and [url removed, login to view] (containing all the trips taken in a single day). The program will process these files and produce a file: [url removed, login to view] (containing billing information), and also will print summary information on the screen...

Example of How Program Should Work:

NOTE: There are no specific test dialog examples, but a general description how the program should run. Please read this section very carefully to help plan, write and test out your solution.

The [url removed, login to view] file contains one record (line) for each town with a town ID and a town price. The towns are listed, starting at Toronto. An example of 5 towns is:

7 0.00

15 5.00

22 10.00

3 15.50

40 25.00

The first town (Toronto) has an ID of 7 and a price of $0.00. The second town has an ID of 15 with a price of $5.00, etc. The cost of a trip from the 2nd town to the 4th town is $15.50 - $5.00 = $10.50.

The cost of a trip from the 5th town to the 2nd town is $25.00 - $5.00 = $20.00.

The [url removed, login to view] file contains one record for each passenger trip on a single day with an entry town ID, exit town ID and credit card number. A credit card number consists of 11 characters. An example of 6 trips is:

7 15 MC123456789

3 15 AE111222333

3 99 AB432344655

40 40 VZ333222111

40 7 VI010101010

7 40 VI010101010

Your program must write one record to the [url removed, login to view] file for each trip containing the credit card number, entry town ID, exit town ID and trip cost. If either the entry or exit town ID is not found in the prices file, or if the entry town equals the exit town, then the record must indicate an error and show the town IDs. The data must be neatly aligned. An example, based on the above files is:


MC123456789 7 15 $ 5.00

AE111222333 3 15 $10.50



VI010101010 40 7 $25.00

VI010101010 7 40 $25.00


NOTE: Summary lines are to be printed on the screen showing the number of valid and invalid trips, and the total cost of all trips. For example:

Number of valid trips processed: 4

Number of invalid trips processed: 2

Total trip revenue: $65.50

Additional Considerations:

Because your program must search the price data for each trip, it is efficient to first load the town and price data into arrays. However, because of the possible size of the trip file you should not load the trip data into an array.

For each trip your program must search for the trip's entry town and exit town, so you must code and use this function:

int search( int data[ ], double value[ ], int size, int key, double *pkeyValue)

that will sequentially search the dataarray (containing size number of items) for the value of the parameter key. If the key is found then set the last parameter to the value of the corresponding item from the value array, and return 1 (true). Return 0 (false) if the value is not found.

Taidot: C-ohjelmointi

Näytä lisää: program billing, billing report, billing program, program example billing, pkeyvalue programming, rpt test, report how to write, parts town, out of office message, on line data entry test, n equals, line card examples, int size c, how you write report, how write report, how to write report, how to write a summary report, how to write a report for work, how to run an office, how can write report, how can write a report, how can one write a report, how 2 write a report, fleet one, dialog information technology

Tietoa työnantajasta:
( 7 arvostelua ) Stouffville, Canada

Projektin tunnus: #412982

Myönnetty käyttäjälle:


Hello.. Please, check PMB...

$30 USD 1 päivässä
(2 Arvostelua)

17 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön


C/C++ program within 3 hours of accepting bid will be provided to you with full reliability and quality. Thanks.

$100 USD 0 päivässä
(7 arvostelua)

Dear sir, I can do it for you, Could you see PMB for more details? Thanks. Best Regards.

$30 USD 1 päivässä
(55 arvostelua)

Hello! Please check PM for details. Thanks

$30 USD 1 päivässä
(19 arvostelua)

Hi, please check PMB. Thanks.

$30 USD 1 päivässä
(13 arvostelua)

Greetings! Please see PMB. Thank you.

$50 USD 1 päivässä
(1 arvostelu)

Hi, Please check PMB. Regards Abhi

$30 USD 0 päivässä
(1 arvostelu)

I have experience with these kinds of projects that have simple text file parsing and data searching. I will be able to deliver the completed software within a day and the end result shall meet your expectations entire Lisää

$40 USD 1 päivässä
(1 arvostelu)

Dear Anile8er, I am a senior C/C++ developer with 4 years of professional programming experience. Please check [login to view URL] for details about my background. The project is interesting and I would b Lisää

$30 USD 1 päivässä
(0 arvostelua)

Please, check your PM

$30 USD 1 päivässä
(0 arvostelua)

It is an easy job.

$30 USD 1 päivässä
(0 arvostelua)

Waiting for your go ahead.....

$30 USD 1 päivässä
(0 arvostelua)

will do it for free. But it is being my first project. Want nominal amount.

$30 USD 2 päivässä
(1 arvostelu)

Hi, This can be done in a few hours. Please check PM. cheers.

$30 USD 0 päivässä
(0 arvostelua)

i am interested in developing the project.

$35 USD 1 päivässä
(0 arvostelua)

I could do this project with great ease.

$60 USD 1 päivässä
(0 arvostelua)

Hi, I will finish this project in few hours, if interested please contact me. Please check your PM

$30 USD 0 päivässä
(0 arvostelua)