CJCoding With Joseph
15free / daySign inCreate account

Read Mixed Values

The starter first writes the single line Alice 30 5.5 into person.txt (that part is done for you), then opens the file as ifstream in. Three variables are declared: string name, int age and double height. At the marked comment, read the three values from the file, in that order, using >>. The existing cout line then prints the output shown in Expected Output.

That line is the only output.

Expected Output:

Alice is 30 years old

= newline. The output ends with a newline — print one after the last line.

Hints2 available
Topics:
Streamsifstream
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.