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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
|
#include <iomanip>
#include <iostream>
#include <string>
#include "Tires.h"
#include "Vehicle.h"
#include "Customer.h"
#include "WinterTires.h"
using namespace std;
//Function prototypes
string goodTires();
string betterTires();
string bestTires();
string tireSize();
int main()
{
//Declaring Variables
string quantity;
string typeoftire;
string sizeoftire;
string name;
string phoneNumber;
string carYear;
string carMake;
string carModel;
int selection;
char again = 'Y';
cout << "//////////////////////// " << endl;
cout << "/Welcome to Monroy tire/" << endl;
cout << "////////////////////////\n\n" << endl;
cout << "Enter customer information " << endl;
cout << "Name: ";
cin >> name;
cout << "Phone Number: ";
cin >> phoneNumber;
cout << "Enter Vehicle year: ";
cin >> carYear;
cout << "Enter Vehicle make: ";
cin >> carMake;
cout << "Enter Vehicle model: ";
cin >> carModel;
cout << "Please select an option" << endl;
cout << "1.Buy tires" << endl;
cout << "2.Speak to a Manager" << endl;
cout << "Enter you selection: ";
cin >> selection;
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n'); //Got this from the internet, Program did an infinite loop if I put a letter and this solved it
switch(selection)
{
case 1:
cout << "which tires would you want" << endl;
int tireChoice;
cout << "1. Good ($54.00 - $75.00 each tire)" << endl;
cout << "2. Better($70.00 - 101.00 each tire" << endl;
cout << "3. Best ($87.00 - $115.00 each tire)" << endl;
cout << "Enter 1 for Good, 2 for better, 3 for Best" << endl;
cin >> tireChoice;
//Call function based on user selection
if (tireChoice == 1)
{
typeoftire = goodTires();
sizeoftire = tireSize();
}
else if (tireChoice == 2)
{
typeoftire = betterTires();
sizeoftire = tireSize();
}
else if(tireChoice == 3)
{
typeoftire = bestTires();
sizeoftire = tireSize();
}
break;
case 2:
cout << "The manager will be out to attend you " << endl;
break;
default:
cout << "Please select a number 1 or 2" << endl;
break;
}
cout << "How many tires would you want today? ";
cin >> quantity;
Vehicle customerVehicle(carYear, carMake, carModel); //Customers Car details
Tires customerTire(typeoftire, sizeoftire); //Customer Chosen tire
Customer newCustomer(name, phoneNumber, customerTire, customerVehicle); //Customer's profile
customerTire.getmanufacturer();
system("pause");
return 0;
}
string goodTires()
{
int choice;
string goodtire;
cout << "You have chosen good, These tires are available" << endl;
cout << "1. Veento ($54.00 each tire)" << endl;
cout << "2. Ohtsu ($69.00 each tire)" << endl;
cin >> choice;
if (choice == 1)
{
goodtire = "Veento";
}
else if (choice == 2)
{
goodtire = "Ohtsu";
}
return goodtire;
}
string betterTires()
{
int choice;
string bettertire;
cout << "You have chosen Better, These tire are available" << endl;
cout << "1.Yokohama ($70.00 each tire)" << endl;
cout << "2.Falken ($92.00 each tire) " << endl;
cout << "3.Goodyear ($101.00 each tire) " << endl;
cin >> choice;
if (choice == 1)
{
bettertire = "Yohohama";
}
else if (choice == 2)
{
bettertire = "Falken";
}
else if (choice == 3)
{
bettertire = "Goodyear";
}
return bettertire;
}
string bestTires()
{
double pirelli = 90.00;
int choice;
string besttire;
cout << "You have chosen Best, These tires are available" << endl;
cout << "1. Pirelli ($90.00 each tire)" << endl;
cout << "2. Bridgestone ($100.00 each tire)" << endl;
cout << "3. Michelin ($110.00 each tire)" << endl;
cin >> choice;
if (choice == 1)
{
besttire = "Pirelli";
}
else if (choice == 2)
{
besttire = "Bridgestone";
}
else if (choice == 3)
{
besttire = "Michelin";
}
return besttire;
}
string tireSize()
{
int choice;
string sizeTire;
cout << "1. 215/55R17" << endl;
cout << "2. 225/65R18" << endl;
cout << "3. 195/45R16" << endl;
cout << "Enter your selection: ";
cin >> choice;
if (choice == 1)
{
sizeTire = "215/55R17";
}
else if (choice == 2)
{
sizeTire = "225/65R18";
}
else if (choice == 3)
{
sizeTire = "195/45R16";
}
return sizeTire;
}
|