akeilo;
@jonnin is correct, you need a semicolon after pretty much anything in C++, except preprocessor directives like
#include
,
#pragma
,
#define
, etc.
In addition, on line 26, you had an open bracket instead of a closing bracket, that was probably part of it.
1 2 3 4 5 6 7
|
else
{
return price * discountTwentyPounds
{ // this was affecting your main function right after it.
int main ()
{
|
And, you used the wrong operands for cin and cout. Think of it as << is the stuff going to cout (common output) and >> is the stuff going to cin (common input).
1 2 3 4 5 6
|
// NOT this:
std::cout >> "Enter price per lb: " << std::endl;
std::cin << price;
// YES this:
std::cout << "Enter price per lb: " << std::endl;
std::cin >> price;
|
Why are you using global variables, anyway? I can understand with the const variables for discounts, but the pricePerDay and the numberOfPounds would probably be better in the main.
Also, those if statements just will not work where they are. You'd be better off putting them inside a function, either main or something listed after main, along with your arithmetic operation on line 12. This looks like an unfinished program though, so maybe you were already planning to do that.