Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- int clientNumber;
- string clientName;
- double tax;
- int minTax;
- int talkedMin;
- string input;
- double extraTax;
- double perminute;
- double sum;
- cout << "A list of all the contracts: \n";
- cout << "Minutes included: 10 , Tax: 20 \n";
- cout << "Minutes included: 20 , Tax: 30 \n";
- cout << "Minutes included: 30 , Tax: 40 \n" << endl;
- ofstream append("file.txt", ios::app);
- do
- {
- cout << "Enter the number of the client: ";
- cin >> clientNumber;
- cout << "Enter the client name: ";
- cin >> clientName;
- cout <<"Enter the tax:";
- cin >> tax;
- cout << "Enter the minutes included in the contract: ";
- cin >> minTax;
- cout << "Enter the minutes talked: ";
- cin >> talkedMin;
- cout << "Would you like to proceed with another client? (yes/no?)";
- cin >> input;
- append<< clientNumber << " " << clientName << " " << tax << " " << minTax << " " << talkedMin;
- }
- while(input !="no");
- cout << " " << endl;
- cout << "How much will be the tax for every minute above those in the contract? ";
- cin >> perminute;
- ifstream appendsec("file.txt", ios::app);
- if (minTax < talkedMin)
- {
- sum = (talkedMin - minTax)*perminute;
- cout << "The client with number: " << clientNumber << " has overpassed his/hers minutes included in the contract! New tax is: " << sum + tax <<endl;
- }
- else
- {
- cout << "Everything is good with this client!" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement