So far I have the following code:
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
|
// Purpose: To write a program that displays the number of millimeters higher the current level the ocean level will be in
// in 5, 7, and 10 years.
# include <iostream>
# include <string>
using namespace std;
int main()
{
float X = 10;
string Y="";
X = 5, 7, 10;
cout << X << endl;
cout << "Enter the number of the desired year\n"
<< "tells you the number of millemeters the current ocean level is.: ";
getline(cin, Y);
cin >> Y;
cout << "The number of millimeters higher the current level of the ocean in 5 years is; " << Y = X * 1.5 << '.' << endl;
cout << "The number of millimeters higher the current level of the ocean in 7 years is; " << Y = X * 1.5 << '.' << endl;
cout << "The number of millimeters higher the current level of the ocean in 10 years is; " << Y = X * 1.5 << '.' << endl;
cin >> Y;
cout << "Press the Enter key to continue...";
cin.get();
return 0;
} //end main()
|
, but I get the following error message:
IntelliSense: expession must have integral or unscoped enum type
three times in a row for lines 25, 27, and 29 and I don't understand or know why?
In case the purpose does make sense here are the directions:
2.7: Ocean Levels
Assuming the ocean’s level is currently rising at about 1.5 millimeters per year, write a program that displays
• The number of millimeters higher than the current level that the ocean’s level will be in 5 years,
• The number of millimeters higher than the current level that the ocean’s level will be in 7 years,
• The number of millimeters higher than the current level that the ocean’s level will be in 10 years,
Output labels: Each value should be on a line by itself, preceded by the a label of the form:
In X years the ocean's level will be higher by Y millimeters.
where X is the number of years (5, 7 or 10) and Y is the value you calculate.
Does any else have an idea?