Been having trouble creating a simple loop program. One my third attempt using a fully new code. Function headers are keeping me from testing this first loop.
#include <iostream>
#include <cctype>
usingnamespace std;
#include <iostream>
#include <cctype>
usingnamespace std;
int main;
// PLACE HOLDERS FOR TESTING ONE SECTION AT A TIME.
//int low (low = 999);
//const int SENTINEL = -9999;
int menu;
//Trying to get a repeatable menu option
{
int choice();
for (menu);
cout<<"Select a chioce from the menu below.";
cout<<" A- Find the highest number in a series. ";
cout<<" B- find the lowest number in a series. ";
cout<<"C- Exit ";
cout<< "Enter your selection ";
cin>> choice;
if choice = a
do OptA
if choice = b
do OptB
if choice = c
do OptC
}
//this option should output only the highest number for a usre defined limit to end the loop. Then return to menu.
int OptA;
{
int number()
int limit;
int high (high = -999);
int counter = 0;
cout<<"how many number would you like to compare? ";
cin>>limit;
cout<<"Enter your numbers. ";
cout<< endl;
cin>>number;
if (number > high);
int high = number;
int counter = counter + 1;
while counter < limit;
else cout<< "The highest number is " << high);
cout<< endl);
return(menu);
}
// OptB should output the lowest number entered with a sentinel value ending the loop. Then return to menu
// OptC exits the program.