CUSTOMER
CUSTOMER
1) Customer Interface
A car rental system's customer interface is designed to facilitate easy interaction with rental
services. It enables customers to check vehicle availability and book rentals for specific
dates. This system features an online reservation platform accessible through a dedicated
booking website or the rental company's own site. It ensures a straightforward booking
process, gathering necessary customer details like name, contact information, and
preferences. To improve convenience, it simplifies the process of checking in and out of
vehicles.
a) Analysis
b) Algorithm
Begin newCust
Return
Read customerID
Read name
Display Enter Address:
Read address
Read phoneNumber
Close customerFile
Display a newline
End newCust
c) Coding c++
void readCustData();
void newCustomer() {
if (!customerFile.is_open()) {
return;
getline(cin, customerID);
getline(cin, name);
getline(cin, address);
getline(cin, phoneNumber);
customerFile.close();
d) Flowchart
2.1.2) Search Customer
a) Analysis
Input: searchID
b) Algorithm
Begin searchCustomer
Return
Read searchID
found = true
Display Customer Found!
Display ---------------------------
Else
If found is false
Close customerFile
End searchCustomer
c) Coding c++
void readCustData();
void newCustomer() {
ofstream customerFile("customerData.txt", ios::app);
if (!customerFile.is_open()) {
return;
getline(cin, customerID);
getline(cin, name);
getline(cin, address);
getline(cin, phoneNumber);
customerFile.close();
}
d) Flowchart
2.1.3) Report Customer
a) Analysis
Input: customerFile
b) Algorithm
Begin reportCustomer
Return
Display ---------------------------
Close customerFile
End reportCustomer
c) Coding c++
void reportCustomer() {
ifstream customerFile("customerData.txt");
if (!customerFile.is_open()) {
return;
string line;
getline(customerFile, line);
getline(customerFile, line);
getline(customerFile, line);
customerFile.close();
d) Flowchart
2.1.4) Customer Amount
a) Analysis
Input: customerAmount
Output: totalCustomers
b) Algorithm
Begin customerAmount
End customerAmount
c) Coding c++
void customerAmount() {
cout << "Total Number of Customers: " << totalCustomers << endl;
d) Flowchart