Hey guys, I am working on a project for my work, but it seems to me that this is not so.
I need to take the model of the model and the years of the car, which specific product is suitable. The program is going to write a file with text in it, which will be the html outline that I need, with important information inserted at the right points to quickly add products to our web page. When I use the switch statement or instructions to separate product categories, the input is messed up and does not allow me to answer one of the questions. I can't just use cin because I need to accept dates that look like "2008 - 2009 - 2010 - 2011"
That's what I have so far! This is a regular routine cin, I tried getline, you could quickly c I started yesterday, and I'm pretty new, so forgive me if this is easy to fix, but I can not find anything.
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void proinfo();
int main()
{
system("TITLE This is a Beta of My Product Information Template Version 0.0.2");
cout << "Welcome To My Product Information Template Maker!!! \n It Is Still In Development" << endl;
cout << "\n\nworking features are:" << endl << "\t-None\n" << endl;
system("PAUSE");
system("CLS");
proinfo();
}
void proinfo()
{
int loop(1), protype;
char make[256], model[256], year[256];
string getinput;
while(loop==1)
{
system("CLS");
cout << "Welcome to My Product Information Template Version 0.0.0" << endl;
cout << "Please select the number of the product" << endl;
cout << "type you will be ading!\n" << endl;
cout << "1.Fe - Fe2 Moldings" << endl;
cout << "2.CF - CF2 Moldings" << endl;
cout << "What would you like to do? ";
cin >> protype;
if(protype==1)
{
system("cls");
cout << "You have selected" << endl;
cout << "Fe - Fe2 Moldings\n" << endl;
cout << "Please Enter the Make of the molding" << endl;
cin >> make;
cout << "Please Enter the Model of the molding" << endl;
cin >> model;
cout << "Please Enter the Years this molding fits" << endl;
cin >> year;
cout << "You have just created a template for a(n)" << year << " " << make << " " << model << endl;
cout << "Check My Documents For a file called Fe-Fe2template.txt" << endl;
cout << "Would you like to make another tempalte?" << endl;
cin >> getinput;
if(getinput=="yes")
{
cout << "Great, Lets keep working!" << endl;
}
system("PAUSE");
}
if(protype==2)
{
system("cls");
cout << "Would you like to make another tempalte?" << endl;
cin >> getinput;
if(getinput=="yes")
{
cout << "Great, Lets keep working!" << endl;
}
system("PAUSE");
}
}
}
source
share