| | |
Program design (help)
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2004
Posts: 4
Reputation:
Solved Threads: 0
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...
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...
•
•
Join Date: May 2004
Posts: 4
Reputation:
Solved Threads: 0
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;
}
}
}
#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;
}
}
}
![]() |
Similar Threads
- Web Graphic Programs....Design? (Graphics and Multimedia)
- Executable program design question.... (Java)
- program (C)
- program design (Visual Basic 4 / 5 / 6)
- Program design tools (C++)
Other Threads in the C++ Forum
- Previous Thread: Clearing the screen
- Next Thread: can somebody limit this program up to 3 users??(c++)
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





