#include <iostream>
usingnamespace std;
int main()
{
float celsiusAtDepth,
toFahrenheit,
depth;
//cout asking for user input
cout << "Please input the depth in km: ";
cin >> depth;
//Calculations needed to find temperatures
celsiusAtDepth = 10 * depth + 20;
toFahrenheit = 1.8 * celciusAtDepth + 32;
//cout to display temperatures
cout << "The temperature is " << celsiusAtDepth << " degrees Celcius, and " << toFahrenheit << " degrees Fahrenheit.";
return 0;
}
I am unsure what is wrong and I've spent days trying to figure it out!
This is the error I got from compileonline:
main.cpp: In function ‘int main()’:
main.cpp:13:24: error: ‘celciusAtDepth’ was not declared in this scope
toFahrenheit = 1.8*celciusAtDepth+32;
Thanks!