[TCLite] [C++] Help With Looping (I think)

Program: Write a program that will give a person their fee for riding in a Taxi. It costs $2.00, plus an additional $.75 for every QUARTER-MILE.

-------------------------------------------------------------------------------

I'm fairly positive the issue is with my looping, I am still struggling with it. Although I just learned Branching, I'm fairly confident in my Branching and do not think the error is anything in the Branching.

I have a strong feeling that it has something to do with my "{ }"'s (my braces). I don't know if I put the wrong one in somewhere, or if I am missing one some where.

Would really appreciate the help from someone, thanks in advance!

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
//Taylor Lynch
//Taxi1
//Calculate the cab fare for a ride with the number of quarter-miles entered by the user
//Period 5

#include <iostream.h>
#include <conio.h>
#include <dos.h>
#include <stdio.h>

main()
{

        textcolor(LIGHTCYAN);
        textbackground(BLACK);	
        clrscr();

	float qmiles, fare1;
	cprintf(“Please enter the number of QUARTER MILES traveled: “);	
	cin>>qmiles;
	if(qmiles<=1&&qmiles>=0)
	{
	cprintf(“Your total cab fare is $2.00”);
	}
	if(qmiles>1)
	fare1=(qmiles-1)*.75+2;
	cprintf(“Your total cab fare is $%o.2f. “, fare1);
	}
	if(qmiles<0
	{
	cprintf(“ERROR! Please enter a number larger than 0”);
	}
getch();
return 0;
}
Last edited on
There is missing a curly bracket ({) at line 25-26?

Indentation usually helps a lot with this in the beginning.
You're just missing an open brace after line 25
Thank you both, cannot believe I couldn't see that, looked at it for almost an hour trying to figure out what was wrong.
Topic archived. No new replies allowed.