Site hosted by Angelfire.com: Build your free website today!

Code

This page will change very often as it is needed
This is the final.cpp file (still progressing)

/*
Final.cpp	IT240
Group Members:
	Anne Potts
	Kevin Morrow
	Kevin Ford
	Joe Dobsen
*/


//Start code by Kevin Morrow

#include 
#include 
#include 




void main()
{
	char uip;
	char mod;
	char type;
	char ch2;
	char ch4;
	char answ = 'N';



	while(toupper(answ) != 'Y')
	{
		system("cls");
		cout << "\t\t\tJeeps 4 Cheap\n\n";
		cout << "Please make a selection from the menu.\n\n";
		cout << "  A - Place an order\n";
		cout << "  B - Print a report\n";
		cout << "  C - Quit\n\n";
		cin >> uip;
		uip = toupper(uip);

		switch (uip)
		{
			case 'A':
				while(toupper(answ) != 'Y')
				{
					system("cls");
					cout << "\t\t\tJeeps 4 Cheap\n\n";
					cout << "What model Jeep would you like?\n";
					cout << "  A - Wrangler\n";
					cout << "  B - Liberty\n";
					cout << "  C - Grand Cherokee\n";
					cout << "  D - Quit\n";
					cin >> mod;
					mod = toupper(mod);

					switch(mod)
					{
						case 'A':
							//Begin code by Kevin Ford
							while (toupper(answ) != 'Y')
							{
								system("cls");
								cout << "\t\tJeeps 4Cheap\n\n";
								cout << "What model of Wrangler would you like?\n";
								cout << "  A - Wrangler SE\n";
								cout << "  B - Wrangler X\n";
								cout << "  C - Wrangler Sport\n";
								cout << "  D - Wrangler Sahara\n";
								cout << "  E - Quit\n";

								cin>> type;
								type = toupper (type);
								switch(type)
								{
									case 'A':
										cout << "You chose Wrangler SE\n";
										break;
									case 'B':
										cout << "You chose Wrangler X\n";
										break;
									case 'C':
										cout << "You chose Wrangler Sport.\n";
										break;
									case 'D':
										cout << "You chose Wrangler Sahara.\n";
										break;
									case 'E':
										cout << "You chose to quit\n";
										answ = 'Y';
										break;
									default:
										cout << "This is multiple choice, not fill in the blank...try again.\n";
								}
							}
							//End code by Kevin Ford (Slight modifications by Kevin Morrow)
							break;
						case 'B':
							cout << "You chose Liberty.\n\n";
							//Open Liberty function
							break;
						case 'C':
							while(toupper(answ) != 'Y')
							{
								system("cls");
								cout << "\t\t\tJeeps 4 Cheap\n\n";
								cout << "Choose a vehicle type.\n";
								cout << "  A - Grand Cherokee 2WD\n";
								cout << "  B - Grand Cherokee 4WD\n";
								cout << "  C - Quit\n";
								cin >> type;
								type = toupper(type);
									switch(type)
									{
										case 'A':
											while(toupper(answ) != 'Y')
											{
												system("cls");
												cout << "\t\t\tJeeps 4 Cheap\n\n";
												cout << "Choose a specific model.\n";
												cout << "  A - Grand Cherokee Laredo 2WD\n";
												cout << "  B - Grand Cherokee Limited 2WD\n";
												cout << "  C - Quit\n";
												cin >> ch2;
												ch2 = toupper(ch2);
												switch(ch2)
												{
													case 'A':
														cout << "You chose the Grand Cherokee Laredo 2WD\n\n";
														//Open color function
														break;
													case 'B':
														cout << "You chose the Grand Cherokee Limited 2WD\n\n";
														//Open color function
														break;
													case 'C':
														cout << "You chose to Quit.\n\n";
														answ = 'Y';
														break;
													default:
														cout << "This is multiple choice, not fill-in the blank... try again.\n\n";
												}
											}
											break;
										case 'B':
											while(toupper(answ) != 'Y')
											{
												system("cls");
												cout << "\t\t\tJeeps 4 Cheap\n\n";
												cout << "Choose a specific model.\n";
												cout << "  A - Grand Cherokee Laredo 4WD\n";
												cout << "  B - Grand Cherokee Limited 4WD\n";
												cout << "  C - Grand Cherokee Overland 4WD\n";
												cout << "  D - Quit\n";
												cin >> ch4;
												ch4 = toupper(ch4);
												switch(ch4)
												{
													case 'A':
														cout << "You chose the Grand Cherokee Laredo 4WD\n\n";
														//Open color function
														break;
													case 'B':
														cout << "You chose the Grand Cherokee Limited 4WD\n\n";
														//Open color function
														break;
													case 'C':
														cout << "You chose the Grand Cherokee Overland 4WD\n\n";
														//Open Special color list (Overland doesn't have full color choices)
														break;
													case 'D':
														cout << "You chose to Quit.\n\n";
														answ = 'Y';
														break;
													default:
														cout << "This is multiple choice, not fill-in the blank... try again.\n\n";
												}
											}
											break;
										case 'C':
											cout << "You chose to Quit.\n\n";
											answ = 'Y';
											break;
										default:
											cout << "This is multiple choice, not fill-in the blank... try again.\n\n";
									}
								}
							break;
						case 'D':
							cout << "You chose to Quit.\n\n";
							answ = 'Y';
							break;
						default:
							cout << "This is multiple choice, not fill-in the blank... try again.\n\n";
					}
				}
				break;
			case 'B':
				cout << "You wish to print a report\n\n";
				//Open report printing function
				break;
			case 'C':
				cout << "You wish to exit the program.\n\n";
				answ = 'Y';
				break;
			default:
				cout << "Were the choices you had that difficult?\n\n";
		}

	}
	cout << "Thank you for using the program.\n";
	system("pause");
}

//End code by Kevin Morrow


This is the login.cpp (this will be incorporated further into the final it is not up to date, as Anne has added to this file) /* Login.cpp IT240 Group Members: Anne Potts Kevin Morrow Kevin Ford Joe Dobsen */ //Start code by Kevin Morrow #include #include #include #include void main() { char nusen[256]; //User name input to compare to file char usen[256] = "God"; //user name from file to match //char npw[]; //user input password to compare to file //char pw[]; //user password from file to match int check = 2; system("cls"); cout << "\n\n\n Please input your user name.\n\n\t"; gets(nusen); /* search file for name and get name (usen) and password (pw) from file. If no name match output not authorized user line */ check = strcmp(usen, nusen); if(check == 0) { cout << "Hello God. Have you had a good day?\n"; } else { cout << "You are " << nusen <<".\n"; cout << "That is unacceptable input. DIE!!!\n"; } } //End code by Kevin Morrow
This is the portion of the ordering part of the final.cpp (Kevin is progressing well on this) /* final.cpp IT240 Group members: Anne Potts Kevin Morrow Kevin Ford Joe Dobsen */ //Start code Kevin Ford #include #include #include void order() { char mod; char answ = 'N'; float price; while (toupper(answ) != 'Y') { system("cls")' cout << "What model of Wrangler would you like?\n"; cout << " A - Wrangler SE\n"; cout << " B - Wrangler X\n"; cout << " C - Wrangler Sport\n"; cout << " D - Wrangler Sahara\n"; cout << " E - Quit\n"; //forgot this line, but you had it in the case statement cin>> mod; mod = toupper (mod); //Open Wrangler function switch(mod) { case 'A': cout << "You chose Wrangler SE\nl"; strcpy(model, "Jeep Wrangler SE"); price = 15815.00 break; case 'B': cout << "You chose Wrangler X\n"; //mod << = "Wrangler X\n"; break; case 'C': cout << "You chose Wrangler Sport.\n"; //mod << = "Wrangler Sport\n"; break; case 'D': cout << "You chose Wrangler Sahara.\n"; //mod << = "Wrangler Sahara\n"; break; case 'E': cout << "You chose to quit\n"; answ = 'Y'; break; default: cout << "This is multiple choice, not fill in the blank...try again.\n"; } } //Didn't have the close brace on the while statement or the function } //End code by Kevin Ford (Don't forget to close your code with a comment) //Function: get Data //Choose color of vehicle //Input color //} //Void getData(Total cost of vehicle) //{ // switch (vehicleCost) // cout << "Enter type (SE, X, Sport, Sahara) and press . "; // cin >> modelType; //case 'SE': $15,815.00; // break; // case 'X': $18,995.00; // break; // case 'Sport': $20,665.00; // break; // case "Sahara': $24,035.00 // break
This is the portion from Joe. (has not been fully screened)(has 2 .dat files associated with it that are not posted here. I am assuming that they will create as necessary, but I could be wrong since I haven't looked at the code) /* Final.cpp Group Members Anne Potts Kevin Morrow Kevin Ford Joe Dobson */ // Start code by Kevin Morrow #include #include #include #include #include #include // Added by Joe Dobson void color() // Start code by Joe Dobson { char mod; char answ = 'N'; while(toupper(answ) != 'Y') { // Open Color Menu system("cls"); ofstream outfile; /*ANNE:This should not be opened until the final deposit of all variables.*/ outfile.open("Customer.dat", ios::app); cout << "\tJeeps 4 Cheap COLOR MENU\n\n"; cout << "What color Jeep are you interested in?\n\n"; cout << " A - Bright Silver Metallic\n"; cout << " B - Flame Red\n"; cout << " C - Black\n"; cout << " D - Steel Blue Pearl Coat\n"; cout << " E - Salsa Red Pearl Coat\n"; cout << " F - Stone White\n"; cout << " G - Patriot Blue Pearl Coat\n"; cout << " H - Woodland Brown Satin Glow\n"; cout << " I - Dark Garnet Red Pearl Coat\n"; cout << " J - Shale Green Metallic\n"; cout << " K - Proceed to OPTION MENU.\n\n"; cin >> mod; outfile << mod; /*ANNE:You are saving a single character to file.. why?*/ cout << endl; mod = toupper(mod); outfile.close(); switch(mod) { case 'A': system("color 8F"); /*ANNE:Can this be done with % codes?*/ cout << "Your Jeep will come in Bright Silver Metallic.\n\n"; break; case 'B': system("color 8C"); cout << "Your Jeep will come in Flame Red.\n\n"; break; case 'C': system("color 80"); cout << "Your Jeep will come in Black.\n\n"; break; case 'D': system("color 89"); cout << "Your Jeep will come in Steel Blue Pearl Coat.\n\n"; break; case 'E': system("color 84"); cout << "Your Jeep will come in Salsa Red Pearl Coat.\n\n"; break; case 'F': system("color 8F"); cout << "Your Jeep will come in Stone White.\n\n"; break; case 'G': system("color 81"); cout << "Your Jeep will come in Patriot Blue Pearl Coat.\n\n"; break; case 'H': system("color 8D"); cout << "Your Jeep will come in Woodland Brown Satin Glow.\n\n"; break; case 'I': system("color 85"); cout << "Your Jeep will come in Dark Garnet Red Pearl Coat.\n\n"; break; case 'J': system("color 82"); cout << "Your Jeep will come in Shale Green Metallic.\n\n"; break; case 'K': system("color 07"); answ = 'Y'; break; default: cout << "Please make another selection.\n\n"; } } } // End code by Joe Dobson void packA() // Start code by Joe Dobson { cout << "This package includes only Standard Features.\n\n"; } // End code by Joe Dobson void packB() // Start code by Joe Dobson { cout << "This package includes Standard and the following Added Features.\n\n"; cout << "Air conditioning.\n"; cout << "Convenience Group I Cargo Trim Panel w/Storage Net.\n"; cout << "Lamp - Cargo Compartment.\n"; cout << "Lamps - Map/Dome Reading.\n"; cout << "Power Outlet - Rear.\n"; cout << "Sun Visors - Illuminating Vanity Mirrors.\n"; cout << "Floor Mats - Front & Rear.\n"; cout << "Power Convenience Group Illuminating Entry.\n"; cout << "Keyless Entry - remote.\n"; cout << "Locks - Power, Speed Sensitive.\n"; cout << "Mirrors - Power, Fold-Away.\n"; cout << "Roof Rack.\n"; cout << "Spare Tire - Full Size.\n"; cout << "Wheels - 16 X 7.0 Lux Style Steel.\n"; cout << "Windows - Power, Driver One-Touch.\n\n"; } // End code by Joe Dobson void packF() // Start code by Joe Dobson { cout << "This package includes only Standard Features.\n\n"; } // End code by Joe Dobson void packG() // Start code by Joe Dobson { cout << "This package includes Standard and the following Added Features.\n\n"; cout << "Air conditioning.\n"; cout << "Convenience Group I Cargo Trim Panel w/Storage Net.\n"; cout << "Lamp - Cargo Compartment.\n"; cout << "Lamps - Map/Dome Reading.\n"; cout << "Power Outlet - Rear.\n"; cout << "Sun Visors - Illuminating Vanity Mirrors.\n"; cout << "Floor Mats - Front & Rear.\n"; cout << "Power Convenience Group Illuminating Entry.\n"; cout << "Keyless Entry - remote.\n"; cout << "Locks - Power, Speed Sensitive.\n"; cout << "Mirrors - Power, Fold-Away.\n"; cout << "Roof Rack.\n"; cout << "Spare Tire - Full Size.\n"; cout << "Wheels - 16 X 7.0 Lux Style Steel.\n"; cout << "Windows - Power, Driver One-Touch.\n\n"; } // End code by Joe Dobson void package() // Start code by Joe Dobson { char mod; char answ = 'N'; while(toupper(answ) != 'Y') { system("cls"); ofstream outfile; outfile.open("Customer.dat", ios::app); /*ANNE:again, this needs to be in one fell swoop rather then opened and closed repeatedly.*/ cout << "\tJeeps 4 Cheap PACKAGE MENU\n\n"; cout << "Please select an options package.\n\n"; cout << " A - Liberty Sport 2WD option package A.\n"; cout << " B - Liberty Sport 2WD option package B.\n"; cout << " C - Liberty Limited Edition 2WD option package F.\n"; cout << " D - Liberty Limited Edition 2WD option package G.\n"; cout << " E - Liberty Sport 4WD option package A.\n"; cout << " F - Liberty Sport 4WD option package B.\n"; cout << " G - Liberty Limited Edition 4WD option package F.\n"; cout << " H - Liberty Limited Edition 4WD option package G.\n"; cout << " I - Move up one menu.\n\n"; cin >> mod; outfile << mod; /*ANNE:Single character to file will not help us much. Also this will append to the end like the other in one continous stream. (ie. useless to us)*/ cout << endl; mod = toupper(mod); outfile.close(); switch(mod) { case 'A': packA(); break; case 'B': packB(); break; case 'C': packF(); break; case 'D': packG(); break; case 'E': packA(); break; case 'F': packB(); break; case 'G': packF(); break; case 'H': packG(); break; case 'I': answ = 'Y'; break; default: cout << "Please make another selection.\n\n"; } } } // End code by Joe Dobson void option() // Start code by Joe Dobson { char mod; char answ = 'N'; while(toupper(answ) != 'Y') { system("cls"); ofstream outfile; /*ANNE:Again with the file*/ outfile.open("Customer.dat", ios::app); cout << "\tJeeps 4 Cheap OPTION MENU\n\n"; cout << "Please select a model and options package.\n\n"; cout << " A - Listing of Options & Prices.\n"; cout << " B - Return to Order Menu.\n\n"; cin >> mod; outfile << mod; /*ANNE:again with the append*/ cout << endl; mod = toupper(mod); outfile.close(); switch(mod) { case 'A': package(); break; case 'B': answ = 'Y'; break; default: cout << "Please make another selection.\n\n"; } } } // End code by Joe Dobson void order() // Start code by Kevin Morrow { char mod; char answ = 'N'; while(toupper(answ) != 'Y') { system("cls"); cout << "\tJeeps 4 Cheap ORDER MENU\n\n"; cout << "What model Jeep are you interested in?\n\n"; cout << " A - Wrangler\n"; cout << " B - Liberty\n"; cout << " C - Grand Cherokee\n"; cout << " D - Return to main menu\n\n"; cin >> mod; cout << endl; mod = toupper(mod); switch(mod) { case 'A': cout << "You chose a Wrangler.\n\n"; // model = "Wrangler"; // Open Wrangler function break; case 'B': // Start code by Joe Dobson // Open Liberty function char fname[16]; char lname[16]; // Open Order Routine { ofstream outfile; /*ANNE:Stop of review since issues need to be addressed*/ outfile.open("Customer.dat", ios::app); cout << "You chose a Liberty.\n\n"; outfile << "\n\nLiberty\n"; cout << "Customers first name?\t"; cin >> fname; outfile << fname << endl; cout << endl; cout << "Customers last name?\t"; cin >> lname; outfile << lname << endl; cout << endl; color(); option(); outfile.close(); } break; // End code by Joe Dobson case 'C': cout << "You chose a Grand Cherokee.\n\n"; // model = "Grand Cherokee"; // Open Grand Cherokee funtion break; case 'D': answ = 'Y'; break; default: cout << "Please make another selection.\n\n"; } } } // End code by Kevin Morrow void report() // Start code by Joe Dobson { char mod; // char finance; // char order; char answ = 'N'; while(toupper(answ) != 'Y') { system("cls"); cout << "\tJeeps 4 Cheap REPORT MENU\n\n"; cout << " A - Enter Finance Data\n"; cout << " B - Finance Report\n"; cout << " C - Order Report\n"; cout << " D - Return to main menu\n\n"; cin >> mod; cout << endl; mod = toupper(mod); switch(mod) { case 'A': { int PAYMENT = 0; int TERM = 0; int RATE = 0; int PRINCIPLE = 0; ofstream outfile; outfile.open("App.dat", ios::app); // Enter input items cout << "Enter payment: "; cin >> PAYMENT; outfile.precision(0); outfile << endl << PAYMENT << endl; cout << "Enter term: "; cin >> TERM; outfile.precision(0); outfile << TERM << endl; cout << "Enter rate: "; cin >> RATE; outfile.precision(0); outfile << RATE << endl; cout << "Enter principle: "; cin >> PRINCIPLE; outfile.precision(0); outfile << PRINCIPLE << endl; outfile.close(); cout << endl << endl; } break; case 'B': // Read Finance data { char buffer[256]; ifstream examplefile ("App.dat"); if (! examplefile.is_open()) { cout << "Error opening file"; exit (1); } while (! examplefile.eof() ) { examplefile.getline (buffer,100); cout << buffer << endl; } } break; case 'C': cout << "You chose Order Reports.\n\n"; // order = "Order Report"; // Open Order function break; case 'D': answ = 'Y'; break; default: cout << "Please make another selection.\n\n"; } } cout << endl; } // End code by Joe Dobson void main() // Start code by Kevin Morrow { char uip; char answ = 'N'; while(toupper(answ) != 'Y') { system("cls"); cout << "\tJeeps 4 Cheap MAIN MENU\n\n"; cout << "Please make a selection from the menu.\n\n"; cout << " A - Place an Order\n"; cout << " B - Generate Reports\n"; cout << " C - Quit\n\n"; cin >> uip; cout << endl; uip = toupper(uip); switch(uip) { case 'A': order(); // Open order function //model(); // Open model function break; case 'B': cout << "Do you wish to print a report.\n\n"; report(); // Open report funtion break; case 'C': answ = 'Y'; break; default: cout << "Please make another selection.\n\n"; } } cout << "Are you sure you would like to quit?\n"; cin >> answ; cout << endl; } // End code by Kevin Morrow
Customer input information /* Customer.cpp IT240 Group Members: Anne Potts Kevin Morrow Kevin Ford Joe Dobsen */ //Start code by Kevin Morrow #include //cin and cout #include //for string compare #include //for get #include //for system commands void main() { char answ = 'N'; char custfirst[10]; char custlast[15]; long ssn; char custaddy[25]; char custcity[10]; char custstate[2]; char custzip[5]; char custphone[12]; while(answ != 'Y') { cout << "Input customer's First name "; gets(custfirst); cout << "Input customer's Last name "; gets(custlast); cout << "Input customer's Social Security Number\n"; cout << "use no punctuation (example: 123456789) "; cin >> ssn; cout << "Input customer's address "; gets(custaddy); cout << "Input customer's city "; gets(custcity); cout << "Input customer's state\n"; cout << "(example: WA) "; gets(custstate); cout << "Input customer's ZIP code "; gets(custzip); cout << "Input customer's phone number\n"; cout << "(example: 123-456-7890) "; gets(custphone); cout << endl << endl << endl; cout << custfirst << " " << custlast << endl; cout << ssn << endl; cout << custaddy << endl; cout << custcity << ", " << custstate << " " << custzip << endl; cout << custphone << endl; cout << "Is this correct? "; cin >> answ; answ = toupper(answ); } /* Determine what files are to be output to and build output lines. After files have been sent to close them and continue with model selection. */ } //End code by Kevin Morrow