loop menu program

#include <string>
#include <iostream>


using namespace std;
int main ()

{ //defining
char menuInput;





//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.
closed account (S6k9GNh0)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <string>
#include <iostream>

using namespace 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?
Last edited on
Topic archived. No new replies allowed.