943,734 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2940
  • C++ RSS
May 12th, 2004
1

Program design (help)

Expand Post »
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...
Similar Threads
Reputation Points: 11
Solved Threads: 0
Newbie Poster
gerizzel is offline Offline
4 posts
since May 2004
May 12th, 2004
1

Re: Program design (help)

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.
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
May 15th, 2004
0

here's my C++

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<iostream.h>
#include <string.h>
#include <fstream.h>
#include <cstring.h>
#include <stdlib.h>


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"
<< " "<<customer_id;
cout << "\n \n"<<surname <<initial;
cout << " \n"<< Stnum <<Stname <<StType;
cout << " \n"<<suburb <<state <<postcode;
cout << "E-way motor bill for "<<customer_id << endl << endl;
cout << " Date Time Toll Amount\n";
} // end printHeading

// Function processThisRecord.
processThisRecord(string tag_number, string date, string time, string toll_station, char* toll_station)
{

int toll_station;
amount;

toll_station = A (2.20);
toll_station = B (2.80);
toll_station = C (3.30);
toll_station = D (3.80);

amount = (toll_station);
cout << date << " " << time << " "<< toll_station <<" $" << amountDue << endl;
return amountDue;
}


// Function tollCharge
void tollCharge(string costumer_id) {
cout << endl << endl;
cout << "Total charge usage of E-way " << costumer_id
<< " " << total << endl;

}
}
}
Reputation Points: 11
Solved Threads: 0
Newbie Poster
gerizzel is offline Offline
4 posts
since May 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Clearing the screen
Next Thread in C++ Forum Timeline: can somebody limit this program up to 3 users??(c++)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC