im a little stuck

i cant find the problem


#include <iostream>
#include <Windows.h>
#include <iomanip>

using namespace std;
{
//start of program
int main;
int property value;
int percentage;

float percentage; (0.00)

cout << "please enter the property value -->";
cin >> property value;
cout <<"\n";

//calculation
percentage = ((property value / 100) * 80);

cout << "the insurance value is -->" << fixed << setprecision(2) << percentage;

cout << "\n";
system("pause");
return 0;

//End of program
}

im using visual studio
int property value;

You can't have a variable name with space, change the name to int propertyValue;
OK thank you, always helps with a fresh set of eyes.
i still cant get it to work i get errors
Instead of:
1
2
3
4
{
    //start of program
    int main;
   // ... 


Use:
1
2
3
int main()
{
    //... 


When your compiler is giving you error messages and you want help resolving those, supply the (first few) error messages..
Last edited on
where i have this bit
cout << "the insurance value is -->" << fixed << setprecision(2) << percentage ;
it says it is illegal for class
Preferably the first actual error message including line number and not some paraphrased version that somehow manages to miss all the important parts. Also, if you update code, supply the updated version of the code that's causing the error.

It is important to supply the first error message as subsequent error messages may cascade from the first.
Last edited on
ok the first one links back to my float value and gives me this error

Error 1 error C2371: 'percentage' : redefinition; different basic types c:\users\owen\documents\visual studio 2013\projects\property value\property value\property.cpp 14 1 property value
What do you suppose that error means? Did you define 'percentage' twice?

1
2
3
    int percentage;

    float percentage;


Pick one.
i only have float percentage now i got rid of the int percentage
all working now cheers for the help
Topic archived. No new replies allowed.