Try the fastest way to create flashcards
Question

Write a function called getReading, which returns a Reading structure. The function should ask the user to enter values for each member of a Reading structure, and then return the structure.

Solutions

Verified
Answered 1 year ago
Step 1
1 of 2
Reading getReading()
{
    //create Reading variable that will
    //be returned by the function
    Reading r;
    
    //get data from user
    cout << "Wind speed: " << r.windSpeed << endl;
    cout << "  Humidity: " << r.humidity << endl;
    cout << "Fahrenheit: " << r.temperature.fahrenheit << endl;
    cout << "Centigrade: " << r.temperature.centigrade << endl;
    
    //now return the Reading structure variable
    return r;
}

Create a free account to view solutions

Create a free account to view solutions

Recommended textbook solutions

Starting Out with C++: Early Objects 8th Edition by Godfrey Muganda, Judy Walters, Tony Gaddis

Starting Out with C++: Early Objects

8th EditionISBN: 9780133360929Godfrey Muganda, Judy Walters, Tony Gaddis
844 solutions
Fundamentals of Database Systems 7th Edition by Ramez Elmasri, Shamkant B. Navathe

Fundamentals of Database Systems

7th EditionISBN: 9780133970777Ramez Elmasri, Shamkant B. Navathe
948 solutions
Introduction to Algorithms 3rd Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

3rd EditionISBN: 9780262033848Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
872 solutions
Introduction to Algorithms 4th Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

4th EditionISBN: 9780262046305Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
945 solutions

More related questions

1/4

1/7