//menu
cout << "A - Find the largest # with a known quantity of numbers."<< endl;
cout << "B - Find the smallest # with an unknown quantity of numbers"<< endl;
cout << "C - Quit";
cout << "Please enter your choice ";
cin >> menuInput;
//defining
int largeEntryInput,largeEntryNumber,largeNextNumber;
string laregeEntryInput;
cout << "How many numbers would you like to compare?" << endl; cin >> largeEntryNumber;
//comparing numbers
while ( largeEntryNumber < 1 ) {
cout << "Not a valid number. Please try again." << endl;
cin >> largeEntryNumber;
{ //comparing numbers
cout << "Please type in " << largeEntryNumber << " integer(s), separated by spaces, then press enter." << endl;
cin.get ( largeEntryInput );
if ( largeEntryNumber = 1 ) {
cout << "The largest number is " << largeEntryInput << ".";
//menu
cout << "A - Find the largest # with a known quantity of numbers."<< endl;
cout << "B - Find the smallest # with an unknown quantity of numbers"<< endl;
cout << "C - Quit";
cout << "Please enter your choice ";
cin >> menuInput
}
return 0;
}
I don't have a clue what I am doing. I tried my best and are out of known options to me. Any assistance would be greatly appreciated. I am trying to make a program that revolves around the menus. I need to know how to get the onfo from the people, mathmatically come up with the right answer then have the menu come back up. I am only 4 weeks into C++ programming and my instructor is a prick. He won't explain anything to you. Plus I learn by doing. If someone would help me they can call me at 937 308 2184. I am not looking for someone to do the work for me I am looking to be explained. I have been to just about every forum on the web and I just don't get it reading it. I need to talk about it and do it. Thanks for your time.
#include <string>
#include <iostream>
usingnamespace std;
int main ()
{
char menuInput;
cout << "A - Find the largest # with a known quantity of numbers."<< endl;
cout << "B - Find the smallest # with an unknown quantity of numbers"<< endl;
cout << "C - Quit"; //Need a endl here.
cout << "Please enter your choice ";
cin >> menuInput;
int largeEntryInput,largeEntryNumber,largeNextNumber; //God help us all.
string laregeEntryInput; //Bad name #341234123412341234
cout << "How many numbers would you like to compare?" << endl;
cin >> largeEntryNumber;
while ( largeEntryNumber < 1 )
{
cout << "Not a valid number. Please try again." << endl;
cin >> largeEntryNumber;
}
cout << "Please type in " << largeEntryNumber << " integer(s), separated by spaces, then press enter." << endl;
cin.get ( largeEntryInput );
if ( largeEntryNumber = 1 )
{
cout << "The largest number is " << largeEntryInput << ".";
cout << "A - Find the largest # with a known quantity of numbers."<< endl;
cout << "B - Find the smallest # with an unknown quantity of numbers"<< endl;
cout << "C - Quit";
cout << "Please enter your choice ";
cin >> menuInput
}
return 0;
}
Your code isn't making a lot of sense. I understand your new but as you might now, every bit of code has some logic behind it. Would you please comment some of your code so I can understand your intentions?