PLEASE HELP :( :(

Please, please, please. I know this is a very long code in here and I know what the problem is but I don't know how to fix it. I want to increment track by one,. I belive its incrementing by one, but when track =1,2,3,4. The else if statements don't work. can anyone please help me with this?
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
enum alphbet {a,b};
	
void printoutusersentence ( string &usertypes)
{
	//User types in a sentence
	cout<<"\n\nType in a sentence: ";
	cin>>usertypes;

	//Declare index to find the character in a string
	int index=0;
	int track=0;
	//start a for loop that will keep track of each row to be printed
	for (int track=0;track<5;track++);
				{//start of for loop
					//reset index
					index=0;
			
	do
		{//start do while parenthesis
			
					//declare a variable to store in a character. Declare enum type variable to store in a value
						alphbet store_letter_score;
						char letterstore=usertypes[index];
	
							switch (letterstore)
								{//start switch structure parthesis
								case 'a':store_letter_score=a;
								break;

								case 'b':store_letter_score=b;
								break;
	
								}//End switch structure parenthesis
	//do if statements
	//if track is zero print row 1
		if (track==0)
		{
			for (int col=0;col<1;col++)
			cout<<letters[store_letter_score][col];
		}
		//If track is one print row 2
		 else if (track==1)
		{
			for(int col=1;col<2;col++)
				cout<<letters[store_letter_score][col];
		}
		//If track is 2 print row 3
		 else if (track==2)
		{
			for(int col=2;col<3;col++)
				cout<<letters[store_letter_score][col];
		}
		//If track is 3 print row 4
		 else if (track==3)
		{
			for(int col=3;col<4;col++)
				cout<<letters[store_letter_score][col];
		}
		//If tract is 4 print row 5
		 else if (track==4)
		{
			for(int col=4;col<5;col++)
				cout<<letters[store_letter_score][col]; 
		}
				
	index++;
		}//end do while loop
		while (index<usertypes.length());
		cout<<endl;
				} //end for while loop



}
closed account (Dy7SLyTq)
line 13: you have a semicolon at the end
OMG THANK YOU DTSCode! :D :D Glad someone responded.
closed account (Dy7SLyTq)
no problem :) we dont always respond the fastest but we usually can get to a solution
Topic archived. No new replies allowed.