← Back to Streams
Question 582
Read Mixed Values
Read Mixed Values
The starter first writes the single lineAlice 30 5.5intoperson.txt(that part is done for you), then opens the file asifstream in. Three variables are declared:string name,int ageanddouble height. At the marked comment, read the three values from the file, in that order, using>>. The existingcoutline 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
Sign in to use hintsTopics:
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.