trouble with writing loops

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.
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <iostream>
#include <cctype>

using namespace std;
#include <iostream>
#include <cctype>

using namespace 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. 
do not include libraries twice. you forgot () around the if statements and the while loop.
I saw the library thing after i coped the code.
He forgot () wherever necessary, but wrote it everywhere where it is unnecessary :D

Almost every line has a bug. :S
Last edited on
Topic archived. No new replies allowed.