double is a type of variable, so afterwards you would put a name such as replacementCost. So it would look like this, double replacementCost; .This means that replacementCost can now hold a variable of type double. So if you wanted to test this you could write on the next line replacementCost = 1000; . so now replacementCost now stores the number 1000.
double is a data type so after it you can put the name of the variable like double salary; etc
#include
using namespace std;
int main (void)
{
double value;
cout << "enter value of house: ";
cin >> value:
cout << "80 percent of the value is " << value*.8<< endl;
return 0;
}
}
I'm trying to write a program for school and I'm struggling with how to start it and my book is not helping.
The question in my book is:
- "Many financial experts advise that property owners should insure their homes or buildings for at least 80% of the amount it would cost to replace the structure. Write a program that asks the user to enter the replacement cost of a building and then displays the minimum amount of insurance he or she should buy for the property."
I'm not sure what to put right after double?
#include
using namespace std;
int main ()
{
double
}