Академический Документы
Профессиональный Документы
Культура Документы
class ProductComplaintDetails {
public:
void getProductDetails();
void showProductDetails();
ProductComplaintDetails* next;
private:
char prodName[MAX_STRING_LEN];
double prodID;
double prodPrice;
char customerName[MAX_STRING_LEN];
int customerDissatisfactionRating;
Date dateToday;
Date complaintFiling;
int daysSinceActionDue;
int urgencyOfAction;
int calcDifference(Date dt1, Date dt2);
int countLeapYears(Date dt);
};
void ProductComplaintDetails::getProductDetails() {
cout << "Please follow the given instructions to enter product complaint
details" << endl;
cout << "Enter customer name" << endl;
gets(customerName);
cout << "Enter product name" << endl;
gets(prodName);
cout << "Enter product ID" << endl;
cin >> prodID;
cout << "Enter product price" << endl;
cin >> prodPrice;
cout << "Please rate customer's dissatisfaction with the product on a scale of
1-10" << endl;
cin >> customerDissatisfactionRating;
cout << "Enter the date when customer file the complaint" << endl;
complaintFiling.getDate();
cout << "Enter today's date" << endl;
dateToday.getDate();
daysSinceActionDue = calcDifference(complaintFiling, dateToday);
urgencyOfAction = daysSinceActionDue + customerDissatisfactionRating;
}
void ProductComplaintDetails::showProductDetails() {
cout << "Customer name: ";
puts(customerName);
cout << endl;
cout << "Product name: ";
puts(prodName);
cout << endl;
cout << "Product ID: " << prodID << endl;
cout << "Product Price: " << prodPrice << endl;
cout << "Customer dissatisfaction rating: " << customerDissatisfactionRating <<
endl;
cout << "Urgency of action: " << urgencyOfAction << endl;
cout << "Date of complaint filing by customer: " << endl;
complaintFiling.showDate();
cout << "Date of complaint updation in database: " << endl;
dateToday.showDate();
}
numberOfDaysBeforeDate2 += countLeapYears(dt2);
class complaintFileDatabase {
public:
complaintFileDatabase();
~complaintFileDatabase();
void writeToFile();
void showFile();
void searchUsingId();
void searchhUsingProdName();
private:
fstream fin, fout;
}