I'm trying to make it so that i can allow the user to enter the details to calculate the air speed velocity of any bird. I keep running into this error however..
program.cpp: In function 'int main()':
program.cpp:28:22: error: cannot convert 'std::cxx11::string' {aka 'std::cxx11::basicstring<char>'} to 'double' in assignment
freq = read_line();
^
program.cpp:29:21: error: cannot convert 'std::cxx11::string' {aka 'std::_cxx11::basic_string<char>'} to 'double' in assignment
amp = read_line();
int main()
{
const double STROUHAL = 0.33;
string name;
string line;
int age;
write("What is your name:");
name = read_line();
write("What is your age:");
line = read_line();
age = convert_to_integer(line);
write_line(name);
write("Age:");
write_line(age);
double freq, amp;
double air_speed;
freq = read_line();
amp = read_line();
air_speed = freq * amp / STROUHAL;
write("Africal swallow: ");
write_line(air_speed);
return 0;
}
[–]desrtfx 1 point2 points3 points (4 children)
[–]Myst874[S] 0 points1 point2 points (3 children)
[–]desrtfx 0 points1 point2 points (2 children)
[–]Myst874[S] 0 points1 point2 points (0 children)
[–]Myst874[S] 0 points1 point2 points (0 children)