ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 11 May 2017 My Price 9.00

a simple DVR application

Write an explanation for the correct answers for items 1 - 3.

SCENARIO: 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: }

 

 

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

Indentation used in

.

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

Answers

(11)
Status NEW Posted 11 May 2017 04:05 AM My Price 9.00

-----------

Not Rated(0)