Question: Reina has created a simple DVR application to record her favorite television programs, but her code has some bugs. Shes a big sports fan and

Reina has created a simple DVR application to record her favorite television programs, but her code has some bugs. She’s a big sports fan and always wants to record the broadcasts of sporting events, even if they conflict with another of her favorite programs.
For non-sport favorites, she does not want to record reruns; however, if the scheduled time of a favorite program conflicts with another favorite and will be broadcast again later, she wants to wait and record it in the future.
Unfortunately, her program is not working correctly. Many television programs that she doesn’t want are being recorded; the programs she DOES want are only being recorded if they are broadcast later.
The C# code (with line numbers added) of Reina’s DVR program looks like this:
1: if (isSportsEvent) {
2: RecordShowNow();
3: }
4: else {
5: if (!isConflict || !isRerun) {
6: RecordShowNow();
7: }
8: if (isConflict && isOnLater); {
9: RecordShowLater();
10: }
11: }

Requirement:
1. Which line is causing shows to be recorded now even if there is a conflict?
a. line 4
b. line 5
c. line 8

2. How should line 8 be rewritten?
a. if (isOnLater); {
b. if (isConflict || isOnLater); {
c. if (isConflict && isOnLater) {

3. Reina has placed two control structures (lines 5–7 and lines 8–10) inside her first control
structure. This techniqueis known as:
a. parenting
b. encapsulating
c. nesting

Step by Step Solution

3.30 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets break down each part of the question and analyze the code stepbystep to provide the correct ans... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!