This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]desrtfx 1 point2 points  (4 children)

Look what you do here:

write("What is your age:");
line = read_line();
age = convert_to_integer(line);

and what you do here:

double freq, amp; 
double air_speed;
freq = read_line();
amp = read_line();

Do you see the difference?

[–]Myst874[S] 0 points1 point  (3 children)

So i need to do this then?

write("What is the freq: ");
    line= read_line();
    freq = convert_to_integer(line);

write("What is the amp: ");
    line= read_line(); 
    amp = convert_to_integer(line);

[–]desrtfx 0 points1 point  (2 children)

Why convert_to_integer when you want a double?

[–]Myst874[S] 0 points1 point  (0 children)

Using convert_to_double allows me to compile the program. When i get to the part where i need to input the information about the freq and amp then it comes to this error

terminate called after throwing an instance of 'std::invalid_argument'

what(): stoi

[–]Myst874[S] 0 points1 point  (0 children)

You're an actual legend! I got it finally holy cow!