Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include<iomanip>
- using namespace std;
- const int size = 2;
- struct Persona
- {
- string name;
- string Address;
- string city;
- int zip;
- float AccBal;
- string DatelastPayment;
- };
- void P_inf(Persona[], int);
- int main()
- {
- Persona inf[size];
- char opc;
- int option;
- int x;
- char cha;
- P_inf(inf, size);
- do
- {
- cout << "Enter the account you want ? "; cin >> x;
- x = x - 1;
- cout << "\t\t_______________________" << endl;
- cout << "\t\tMenu " << endl;
- cout << "\t\t1)Name \t 2)Addres" << endl;
- cout << "\t\t3)City \t 4)Zip Code " << endl;
- cout << "\t\t5)AccountBalance 6)DatelastPayment" << endl << endl;
- cout << "Enter a option :"; cin >> option; cout << endl;
- switch (option)
- {
- case 1:
- {
- cout << "Customer Name #" << " : " << inf[x].name << endl << endl;
- cout << "Do you want to change customer name ?(Y/N)"; cin >> cha; cout << endl;
- if (cha == 'y' || cha == 'Y')
- {
- cout << "Customer name #";cin.ignore(); getline(cin, inf[x].name); cout << endl << endl;
- cout << "Customer name change ?" << inf[x].name << endl;
- }
- break;
- }
- case 2:
- {
- cout << "Address #" << inf[x].Address << endl << endl;
- cout << "You want change city ?(Y/N) "; cin >> cha; cout << endl;
- if (cha == 'Y' || cha == 'y')
- {
- cout << "Address :";cin.ignore(); getline(cin, inf[x].Address); cout << endl << endl;
- cout << "Address change :" << inf[x].Address; cout << endl;
- }
- break;
- }
- case 3:
- {
- cout << "City :" << inf[x].city << endl << endl;
- cout << "You want change city ?(Y/N) "; cin >> cha; cout << endl;
- if (cha == 'Y' || cha == 'y')
- {
- cout << "City :";cin.ignore(); getline(cin, inf[x].city); cout << endl << endl;
- cout << "City change :" << inf[x].city; cout << endl;
- }
- break;
- }
- case 4:
- {
- cout << "Zip Code #" << inf[x].zip << endl << endl;
- cout << "Do you want to change Zip Code ?(Y/N)"; cin >> cha; cout << endl;
- if (cha == 'y' || cha == 'Y')
- {
- cout << "Zip Code #"; cin >> inf[x].zip; cout << endl << endl;
- cout << "Zip Code change ?" << inf[x].zip << endl;
- }
- break;
- }
- case 5:
- {
- cout << fixed << showpoint << setprecision(2);
- cout << "Account Balansce $" << inf[x].AccBal << endl << endl;
- cout << "Do you want to change Account Balance ?(Y/N)"; cin >> cha; cout << endl;
- if (cha == 'y' || cha == 'Y')
- {
- cout << "Account Balansce $"; cin >> inf[x].AccBal; cout << endl << endl;
- cout << "Account Balance change $" << inf[x].AccBal; cout << endl;
- }
- break;
- }
- case 6:
- {
- cout << "Account Date last Balance : " << inf[x].DatelastPayment << endl << endl;
- cout << "Do you watn to change Account Balance ?(Y/N)"; cin >> cha; cout << endl;
- if (cha == 'Y' || cha == 'y')
- {
- cout << "Account Date last Balance :"; cin >> inf[x].DatelastPayment; cout << endl << endl;
- cout << "Account Date last Balance change :" << inf[x].DatelastPayment; cout << endl;
- }
- break;
- }
- default:
- {
- cout << "Option not found !" << endl;
- break;
- }
- }cout << endl << endl;
- cout << "Do you want to continue ? "; cin >> opc;
- cout << "_____________________________" << endl << endl;
- }while (opc == 'Y' || opc == 'y');
- cout << "-------------------------------------------------------------------------------" << endl;
- return 0;
- }
- void P_inf(struct Persona p[], int size)
- {
- cout << "\t\t\t*********************" << endl;
- cout << "\t\t\tCustomer Account " << endl << endl;
- for (int i = 0; i < size; i++)
- {
- cout << "Customer #" << (i + 1) << endl;
- cout << "________________________________" << endl;
- cout << "Customer Name #" << " : "; cin.ignore(); getline(cin, p[i].name); cout << endl;
- cout << "Address #"; getline(cin, p[i].Address);
- cout << endl;
- cout << "City :"; getline(cin, p[i].city);
- cout << endl;
- cout << "Zip Code #"; cin >> p[i].zip;
- cout << endl;
- cout << "Account Date last Balance : ";cin.ignore(); getline(cin, p[i].DatelastPayment);
- cout << endl;
- cout << "Account Balanse $"; cin >> p[i].AccBal; cout << endl;
- while (p[i].AccBal < 0)
- {
- cout << "Incorrect Value !" << endl;
- cout << "___________________________" << endl;
- cout << "Account Balanse $"; cin >> p[i].AccBal; cout << endl;
- }
- }
- cout << "-------------------------------------------" << endl << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement