Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

1 Shows are being recorded now even if there is a conflict because b Line 5 The conditionalOR return... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Accounting

Authors: J. David Spiceland, Wayne Thomas, Don Herrmann

3rd edition

9780077506902, 78025540, 77506901, 978-0078025549

More Books

Students also viewed these Programming questions