954,184 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Program design (help)

i Need 2 design a program that will be able to read the two files of an EWAY Checkpoint (toll for moterway) and customer database, that will be able to produce a statement for each customer who has non-zero balance.
and includes:

Headings of the statement
Customer information: customer’s name, address and customer number.
Column heading: Date, Time, Station, Amount.
All records charged to the customer.
Total amount the customer owned.

plz show me how 2 do this...

gerizzel
Newbie Poster
4 posts since May 2004
Reputation Points: 11
Solved Threads: 0
 

read in the toll file, read in the customer file. store the customer's data into a structure. if the customers balance is > 0 then print out the data. what is it that u dont know how to do? we dont do homework here. write some code, when u get stuck then ask a specific question.

infamous
Junior Poster in Training
77 posts since Mar 2004
Reputation Points: 47
Solved Threads: 2
 

This is so far what ive done for the c++ part. although, its confusing, becoause i dont know how 2 connect my log.txt file which has the customers tag_number, date, time, and toll with the customer.txt which has the tag_number, and customer details e.g address phone etc.. i dont know what to do with the strings.. plz help


#include
#include
#include
#include
#include


void PrintCustomerStatement()
{

sting tag_number, date, time, toll_station;
char duration[25];
amountDue = 0;
string tagNo = tag_number;

PrintCustomerStatement();

fstream InStream("log.txt", ios::in); // open file

if (InStream.fail()) // check for success
{
cerr << "\n Unable to open 'customer.txt'!\n";
exit (-1);
} // end if


while (!InStream.eof()) // while not end-of-file:
{
InStream >> tag_number; // input tag number
InStream >> date;
InStream >> time;
InStream >> toll_station;


if (tagNo == tag_number)
{
amountDue = PrintCustomerStatement(tag_number, date, time, toll_station);
// invoke subordinate module
totalAmountDue = totalAmount + amount;
} // end if
} // end while


int strcmp (const char*s1, const char*s2)

cout << "Enter Customer ID:";
cin >> customer_id;
int strcmp (customer_id, cust_id)
if customer_id = cust_id
{


// Function Print Customer Statement
void PrintCustomerStatement(){
cout << "\nEWAY BILL E-way Motorway\n"
<< " "<

gerizzel
Newbie Poster
4 posts since May 2004
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You