Question: // // labstruct.cpp // winter 2023 // // Created by Shuhuar Yeh on 1/31/23. // // Completed by ____________________ #include #include #include #include #include using

// // labstruct.cpp // winter 2023 // // Created by Shuhuar Yeh on 1/31/23. // // Completed by ____________________

#include #include #include #include #include

using namespace std;

const int LOC_SIZE = 10; struct Weather { char location[LOC_SIZE]; int precipitation; int humidity; int wind; };

Weather getWeather(); string formatWeather(Weather);

int main() { // Declare a weather structure variable named data // Write your code here . . . // Call getWeather function to read the weather data for a location // and store the data in the variable declared above // Write your code here . . . string output; // Call formatWeather function to format the weather data // and store the formatted output in the variable output. // Write your code here . . . // Insert output to cout cout << output; return 0; }

//****************************************************************************** //* Function: getWeather //* Description: read a line of comma separated weather data from the user and //* return a Weather value to the caller. //* Parameters: none //* Return: a Weather value that contains the weather data. //****************************************************************************** Weather getWeather() { // Create a temporary Weather variable Weather data = {}; // Write your code here . . . return data; }

//****************************************************************************** //* Function: formatWeather //* Description: Use the data stored in the Weather parameter and form an //* output string from the weather data. //* Parameters: //* data - contains the weather data of a location //* //* Return: a string value that contains the formatted output weather data. //****************************************************************************** string formatWeather(Weather data) { string result; // Write your code here . . . return result; }

Input

San Jose, 0, 40, 6

expected output

Loc Precip Humidity Wind

----------------------------------------

San Jose 0 40 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!