Expected primary expression before '}' error

I get the error message on line 14

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
    void money_usadollars()
    {
           
         int amount;
         double total;
         system("cls");  
         cout<<"Converting Pounds Into US Dollars"<<endl;
         cout<<"Enter the amount you want it to be converted to -> "<<endl;
         cin>>amount;
         total=(1.63)*amount;
        { 
         if (total<=100)
         total+2%
         }
         {
         else if (total>100)
         total+1.5%
         
         }
     }
     
This code snip is invalid


{
if (total<=100)
total+2%
}
{
else if (total>100)
total+1.5%

}

First of all what is it total+2% and total+1.5%? And braces are placed incorrectly.
The percent character is not used in C++ to denote percentages.
You need to remove it and convert all your percentages to decimal fractions.
Also you are forgetting to assign the result to a variable.
And your statements are not bracketed correctly.
"Also you are forgetting to assign the result to a variable.
And your statements are not bracketed correctly"

sorry but could you give me some examples, I don't know where I placed the brackets incorrectly and don't know how to assign the result to a variable.
Don't worry I just fixed the problem, thank you for your replies. :)
Topic archived. No new replies allowed.