error do while

Any idea why this won't compile? It is saying an error with the do 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include <iostream>
#include <iomanip>
using namespace std;



//********************************************************************

void menu()                       //menu function prototype to show menu
void  getJobs()						// function to get the input of jobs competed and number of times job has been completed

//********************************************************************

int main()								
{


	menu();                        //call job cost display function
	getJobs();						// call function to gether jobs completed data
	cout << " The total profit made  = " << endl ;		//display total profits


}                               
//******************************************************************************************************************************************
															// end of body
//******************************************************************************************************************************************
//******************************************************************************************************************************************



//******************************************************************************************************************************************
********************************************************************************************************************************************
//															//MENU FUNCTION
//******************************************************************************************************************************************
//******************************************************************************************************************************************
void menu()
{



	cout << "1. Lawn Mow" << setw(5) << "$" << jobs[0] << endl;						// show job prices function***********
	cout << "2. Bushes Trimmed" << setw(5) << "$" << jobs[1] << endl;
	cout << "3. Pressure washing" << setw(5) << "$" << jobs[2] << endl;
	cout << "4. Gutter Cleaning" << setw(5) << "$" << jobs[3] << endl;
	cout << "5. Mulch " << setw(5) << "$" << jobs[4] << endl;
}




//******************************************************************************************************************************************
 //******************************************************************************************************************************************
//										Assignments for determining profits gathered from specific jobs
//*****************************************************************************************************************************************
int choice = 0;

int jobs[5] = { 50, 70, 65, 45, 100 };		

int lawnMowProfit = jobs[0] *= choice;
int bushTrimProfit = jobs[1] *= choice;
int pressureWashProfit = jobs[2] *= choice;						
int gutterCleanProfit = jobs[3] *= choice;
int mulchProfit = jobs[4] *= choice;


//*****************************************************************************************************************************************************
//****************************************************************************************************************************************************
//											***			//GETJOBS FUNCTION ***
//*******************************************************************************************************************************************************


void getjobs();                   //function gathers job completion data and output eache category to it's certain value

do								//do while loop 
{


	cout << "Select the choice of job you have done, then how many times you have done the type of job." << endl << " To finish type done" << endl;
	cin >> choice;




	if (choice == 1)													//if choice is 1, 2, 3, select how many times you completed the job, and output and store values of money made.
	{
		cout << " how many lawn mowing jobs have you completed " << endl;
		cin >> jobs[0];									
		cout << lawnmowProfit;						
	}

	else if (choice == 2)																				
	{
		cout << " How many bush trimming jobs have you had" << endl;
		cin >> jobs[1];
		cout << bushTrimProfit;

	}

	else if (choice == 3)
		cout << " How many pressure washing jobs have   you had"
		cin >> jobs[2];
	cout << pressureWashProfit;

	else if (choice == 4)
		cout << " How many gutter cleaning jobs have you done?" << endl;
	cin >> jobs[3];
	cout << gutterCleanProfit;

	else if (choice == 5)
		cout << " How many mulch jobs have you done" << endl;
	cin >> jobs[4];
	cout << mulchProfit;

} while (choice != done );										//when user types done, program then displays total profits
//*****************************************************************************************************************************************************


Line 72 is a function declaration.
 
void getjobs();


Lines 51 to 69 are not part of any function.
Lines 74 to 115 are not part of any function.

See also duplicate post:
http://www.cplusplus.com/forum/beginner/219743/


Also, missing semicolon at lines 9 and 10.
The earlier version in the other post had them correct.

Suggestion, start with an outline of the program structure, make sure it compiles. Then gradually add the code inside the body of each function.

Also, after adding a block of code, keep checking that it still compiles.

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 <iostream>
#include <iomanip>
using namespace std;

// declare function prototypes
void menu();                       
void getJobs();
    
//*****************************************
// perhaps define global constants and variables here

//*****************************************

int main()
{
    menu();
    getJobs();   
}    
                                
//*****************************************

void menu()
{
    // code for menu function here


}

//*****************************************

void getJobs()
{
    // code for getjobs function here
    
    
}

//*****************************************



Topic archived. No new replies allowed.