i have this given structure:
struct Tempscale
{
double farenheit;
double centigrade;
};
struct Reading
{
int windSpeed;
double humidity;
Tempscale temperature;
};
i am then asked:
define a Reading structure variable
is this ok: Reading data;
write statements that will display following data:
wind speed : 37mph
humidity: 32%
farenheit temperature: 32 degrees
centigrade temperature: 0 degrees
my question:
can i use a declaration and cout statement for the data?
ex:
data.windspeed = 37;
data.humidity = 32;
cout << data.windspeed << "mph" << endl;
cout << data.humidity<< "%" << endl;
i think this is the correct way to write the statement for the first 2, but how do i write a statement that will store the data for the farenehit and centigrade? (since temperature is a TempScale structure variable)
the second part of the question asks me to write a function called findReading that should use Reading structure variable as its parameter. the function should then ask user to enter values for each member of the structure