Jetthreat11
Beta member
- Messages
- 5
Right now i am trying to design this program that allows me to keep track of my Hot Wheels collection. Im stuck on this one part that is supposed to allow me to enter the name of the car. Im pretty sure the part where im supposed to enter the series name is wrong too. All help is appreciated. Thnx. The code reads as follows:
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#define MAXNAMELENGTH 25
using namespace std;
int main()
{
int colnum;
int year;
bool yes;
int seriestotal;
int seriesloc;
char car[MAXNAMELENGTH];
char series[MAXNAMELENGTH];
cout << "\n\n\n\n Enter the collector number: ";
cin >> colnum;
cout << "\n\n Enter the name of the car: ";
cin.get (car, MAXNAMELENGTH);
cout << "\n\n Enter the year of the car: ";
cin >> year;
cout << "\n\n Is your car part of a series (1 = Yes and 0 = No): ";
cin >> yes;
if (yes >= 1) {
cout << "\n\n Enter the name of the cars series: ";
cin.get (series, MAXNAMELENGTH);
cout << "\n\n How many cars are in the series: ";
cin >> seriestotal;
cout << "\n\n What number is the car in the series: ";
cin >> seriesloc;
cout << "\n\n Here is the information you submitted: ";
cout << " " << year << " " << car << " " << seriesloc << "/" << seriestotal << " in the " << series << " series, #" << colnum << " " << "\n\n";
system ("pause");
main ();
}
else if (yes <= 0) {
cout << "\n\n Here is the information you submitted: ";
cout << " " << year << " " << car << " #" << colnum << "\n\n";
system ("pause");
main ();
}
}
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#define MAXNAMELENGTH 25
using namespace std;
int main()
{
int colnum;
int year;
bool yes;
int seriestotal;
int seriesloc;
char car[MAXNAMELENGTH];
char series[MAXNAMELENGTH];
cout << "\n\n\n\n Enter the collector number: ";
cin >> colnum;
cout << "\n\n Enter the name of the car: ";
cin.get (car, MAXNAMELENGTH);
cout << "\n\n Enter the year of the car: ";
cin >> year;
cout << "\n\n Is your car part of a series (1 = Yes and 0 = No): ";
cin >> yes;
if (yes >= 1) {
cout << "\n\n Enter the name of the cars series: ";
cin.get (series, MAXNAMELENGTH);
cout << "\n\n How many cars are in the series: ";
cin >> seriestotal;
cout << "\n\n What number is the car in the series: ";
cin >> seriesloc;
cout << "\n\n Here is the information you submitted: ";
cout << " " << year << " " << car << " " << seriesloc << "/" << seriestotal << " in the " << series << " series, #" << colnum << " " << "\n\n";
system ("pause");
main ();
}
else if (yes <= 0) {
cout << "\n\n Here is the information you submitted: ";
cout << " " << year << " " << car << " #" << colnum << "\n\n";
system ("pause");
main ();
}
}