Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

#include<iostream>

#include<new>

using namespace std;

int main()

{
option:
system("cls");
char letter;

cout<<"Welcome to the Computer Products Inventory."<<endl;


cout<<endl<<"What would you like to do?"<<endl;
cout<<"X=Add Items"<<endl;
cout<<"Y=Remove Items"<<endl;
cout<<"Z=Quit"<<endl;
cout<<endl<<"Type here: "<<endl;
type:
cin>>letter;

switch(letter)
{

case'x':
case 'X': cout<<"You choose to ADD ITEMS."<<endl;
{
char i;
string item[10];
int identificationnum[10];
int quantity[10];

for(i=0;i<10;i++)

{
cout<<endl;
cout<<"Enter item "<<i+1<<":"<<endl;
cin>>item[i];

cout<<"Enter identification number "<<i+1<<":"<<endl;


cin>>identificationnum[i];

cout<<"Enter quantity "<<i+1<<":"<<endl;


cin>>quantity[i];

cout<<"+++++++++++++++++++++++++"<<endl;

{
char letter;

cout<<endl<<"Want to go back from options?(Y/N)"<<endl;


type1:
cout<<"Type here: "<<endl;
cin>>letter;

switch (letter)

{
case 'y':
case 'Y': cout<<"You are about go back from
options."<<endl;
goto option;
break;
case 'n':
case 'N': cout<<endl<<"You are about to exit."<<endl;
break;

default: cout<<"You type it wrong."<<endl;


goto type1;
}
}

break;
case 'y':
case 'Y': cout<<"You choose to REMOVE ITEMS."<<endl;
break;
case 'z':
case 'Z': cout<<"You choose to QUIT the program."<<endl;
break;
default: cout<<"You typed an unacceptable character."<<endl;
cout<<endl<<"Please make sure it is a valid character."<<endl;
cout<<"Type again here. ";
goto type;

}
system("pause");
return 0;
}

You might also like