110k views
3 votes
Assume that a bool variable workedovertime has been declared , and that an int variable hoursworked has been declared and initialized . write a statement that assigns the value of workedovertime to true if hoursworked is greater than 40 and false otherwise.

1 Answer

1 vote
workedovertime = ( hoursworked > 40 ) ? true : false;
User PotatoParser
by
8.0k points