0
class tvShow {
       public:
       string name;
       string dayofweek;
       int lengthInMin;
       double rating;
}

write a sequence of statements that will do the following:
If the show is scheduled for wednesday and the rating is above 20, print We Have a New Hit Show.
if this is not true subtract 5 from the number of minutes.

if ( ..... == "wednesday" && .... == 20.0)
             cout << "We Have a New Hit Show";
else 
            ..... = ..... - 5;

I don't know what to put in where you see the dots.

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by ArkM
0

You can either:

1) declare object of type tvShow and use the dot operator (if you use static memory to declare the object) or the arrow operator (if you use dynamic memory) to access the member variables that you need to fill in the blanks.

2) you could declare and define a member function and access the variables directly without needing to use an operator.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.