1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
/* CSS PETA
GROUP 3
ICT-2 */
#include <iostream>
#include <string>
#include <ctime>
void display_menu(const std::string &manufacturer,
const std::string names[],
const int prices[],
const size_t numCars ) {
std::cout << manufacturer << " Cars\n";
for ( size_t i = 0 ; i < numCars ; i++ ) {
std::cout << i + 1
<< ". "
<< names[i]
<< " for "
<< prices[i]
<< " pesos\n";
}
}
int main()
{
char YesNo, Yes_or_No;
do{
std::cout << "Welcome to Toyota Car Dealership\n"
<< "Here's the list of Cars: \n " ;
std::string toyota_car_names[] = {
"Camry",
"Corolla Altis",
"Vios",
"Wigo",
"Yaris",
"Corolla Cross",
"FJ Cruiser",
"Fortuner",
"Land Cruiser",
"Accord",
"Accord Hybrid",
"Civic",
"Clarity",
"CR-V",
"HR-V",
"Insight",
"Odyssey"
};
int toyota_car_prices[] = {
2042000,
1595000,
1056000,
700000,
1065000,
1650000,
2083000,
2414000,
4950000,
2308000,
2508000,
1115000,
1249000,
1678000,
1296000,
1038000,
2298000
};
display_menu("Toyota",toyota_car_names,toyota_car_prices,17);
std::cout << "Input Number According to the type of Car: ";
int Cars;
std::cin >> Cars;
std::cout << "You selected "
<< toyota_car_names[Cars-1]
<< " for "
<< toyota_car_prices[Cars-1]
<< " pesos\n";
std::cout << "To be Comformed Type Y Yes, if type N if No: ";
std::cin >> Yes_or_No;
if (Yes_or_No == 'y' || Yes_or_No == 'Y') {
std::cout << "You Ordered "
<< toyota_car_names[Cars-1]
<< std::endl;
std::cout << "What Color of "
<< toyota_car_names[Cars-1]
<< " do you want?\n";
int Color;
std::cout << "1. Black\n"
<< "2. Blue\n"
<< "3. Gray\n"
<< "4. Green\n"
<< "5. Red\n"
<< "6. Cyan\n"
<< "7. Yellow\n";
std::cout << "Please select the Number of Color: ";
std::cin >> Color;
if ((Color < 1 ) && (Color > 7)) {
std::cout << "You pick the Wrong number.\n";
}
else if ((Color >= 1) && (Color <= 7)) {
switch(Color) {
case 1:
std::cout << "You pick color Black\n";
break;
case 2:
std::cout << "You pick color Blue\n";
break;
case 3:
std::cout << "You pick color Gray\n";
break;
case 4:
std::cout << "You pick color Green\n";
break;
case 5:
std::cout << "You pick color Red\n";
break;
case 6:
std::cout << "You pick color Cyan\n";
break;
case 7:
std::cout << "You pick color Yellow\n";
break;
}
std::cout << "Do you want to order more? type Y if yes and type N if no: ";
std::cin >> YesNo;
if (YesNo == 'n' || YesNo == 'N') {
int Total, Payment, Change;
Total = toyota_car_prices[Cars-1];
std::cout << "Total Amount: " << Total << "\n";
std::cout << "Enter The Amount of Payment\n";
std::cin >> Payment;
Change = Payment - Total;
if(Change >= 1) {
std::cout << "Change: " << Change << "\n ";
}
else if(Change == 0) {
std::cout << "You paid the exact amount of money needed.\n";
}
else if(Change <= -1) {
std::cout << "You don't have enough money.\n";
}
else {
std::cout << "It seems like there's an error on the system.\n";
}
}
std::cout << "************************************************\n"
<< " Thank for your purchase \n"
<< " We love to hear your feedback \n"
<< " Call: (02) 8-361-8794 \n"
<< " Globe: 09272533969 \n"
<< " Email: JKRBN99@gmail.com \n"
<< " Website: Toyota.com.ph \n"
<< " ************************************************\n";
}
else if (Yes_or_No == 'n' || Yes_or_No == 'N') {
std::cout << "You Canceled the order.\n";
}
}
}
while(YesNo == 'y' || YesNo == 'Y');
}
|