Question

struct TempScale {     double fahrenheit;     double centigrade; }; struct Reading {     int windSpeed;...

struct TempScale {
    double fahrenheit;
    double centigrade;
};

struct Reading {
    int windSpeed;
    double humidity;
    TempScale temperature;
};

Write a function called showReading. It should accept a Reading structure variable (see statement above) as its argument. The function should display the contents of the variable on the screen, written in C++

0 0
Add a comment Improve this question Transcribed image text
Answer #1
void showReading(struct Reading r){
   cout<<"windSpeed = "<<r.windSpeed<<endl;
   cout<<"humidity = "<<r.humidity<<endl;
   cout<<"temperature in fahrenheit = "<<r.temperature.fahrenheit<<endl;
   cout<<"temperature in centigrade = "<<r.temperature.centigrade<<endl;
}

Add a comment
Know the answer?
Add Answer to:
struct TempScale {     double fahrenheit;     double centigrade; }; struct Reading {     int windSpeed;...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT