Weather Station Struct Behind a unique_ptr
mediumQuestion 704The Station struct is already declared for you. Read a one-word city name and an integer temperature from standard input, create a unique_ptr<Station> with make_unique, store both values in the struct through the pointer, then print three lines using ->.
For the input Denver 31 the program prints exactly the output shown in Expected Output.
The third line prints 1 when the stored temperature is less than 32 and 0 otherwise. For the input Miami 80 the last line is Freezing: 0.
Do not write delete and do not use a raw new — this question checks for memory leaks.
Expected output
Station: Denver Temperature: 31 Freezing: 1
= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
Pointers
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.