SHARE
TWEET

Untitled

a guest Jun 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Ex: 01_05 - Di Sieu Thi
  2. //Author: Chu Thanh Hung - 13020208 - K58N
  3. //Date: 18/03/2014
  4.  
  5. #include <iostream>
  6. #include <cstdlib>
  7. #include <string>
  8. #include "DuLieu.h"
  9. #include "MuaHang.h"
  10. using namespace std;
  11.  
  12. int main()
  13. {
  14.     int soSP = SO_MAT_HANG, solgSP[SO_MAT_HANG], i, thutu, pa;
  15.     string tenSP[SO_MAT_HANG];
  16.     double giaSP[SO_MAT_HANG], giatriSP[SO_MAT_HANG], tien;
  17.     for (i = 0; i < soSP; i++) {
  18.         tenSP[i] = MAT_HANG[i];
  19.         solgSP[i] = SO_LUONG[i];
  20.         giaSP[i] = GIA_TIEN[i];
  21.     }
  22.     cout << "Ban mang theo bao nhieu tien: ";
  23.     cin >> tien;
  24.     thutu = thieutien(tien / 1000, solgSP, giaSP);
  25.     if (dutienko(tien / 1000, solgSP, giaSP, thutu) == true) {
  26.         cout << endl << "Ban da mang theo du tien " << endl << endl;
  27.         inhoadon(tenSP, solgSP, giaSP, giatriSP, soSP);
  28.     }
  29.     else {
  30.         cout << endl << "Ban khong mang theo du tien" << endl << endl;
  31.         cout << "Phuong an 1: Mua theo gia thanh (tu nho den lon). " << endl;
  32.         cout << "Phuong an 2: Mua theo gia tri (tu nho den lon). " << endl;
  33.         cout << "Ban muon mua hang theo phuong an nao: ";
  34.         cin >> pa;
  35.         switch (pa) {
  36.             case 1: giathanh(tenSP, solgSP, giaSP, giatriSP); break;
  37.             case 2: giatri(tenSP, solgSP, giaSP, giatriSP); break;
  38.         }
  39.         inhoadon(tenSP, solgSP, giaSP, giatriSP, thutu);
  40.     }
  41.     cout << endl << "Tong so tien phai tra la: " << tggiatri(solgSP, giaSP, thutu) * 1000 << " dong" << endl;
  42.     system("PAUSE");
  43.     return 0;
  44. }
RAW Paste Data
Top