Case-Based Critical Thinking Questions
??
Case 9-2

Gregor, a software developer, is developing a calendar application. He has to use severalifconditional statements to ensure that the calendar displays the exact number of days present in each month of each year. He creates adayCountarray to keep track of the number of days in each month.
?Gregor wants to ensure February contains 29 days only in the year 2020 as it is a leap year. Which of the following should Gregor use to set the value in thedayCountarray?

A. if (thisYear === 2020) {dayCount[1] = 29;}
B. if (dayCount=29){2020;}
C. if {thisYear = 2020;dayCount[1] == 29;}
D. if {dayCount=29 && this year=2020;}


Answer: A

Computer Science & Information Technology

You might also like to view...

Make an audio collage. Make it at least five seconds long, and include at least two different sounds (e.g., come from different files). Make a copy of one of those different sounds and modify it using any of the techniques described in this chapter (e.g., mirroring, splicing, and volume manipulations). Splice together the original two sounds and the modified sound to make the complete collage.

What will be an ideal response?

Computer Science & Information Technology

The ____________________ acts as the "base station" for the wireless devices, sending and receiving wireless signals between all devices as well as providing the "gateway" to the external Internet.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

In the following code, how many Rectangle objects are instantiated?Rectangle rect1;Rectangle rect2;Rectangle rect3 = null;Rectangle rect4 = new Rectangle(3.0, 1.5);

A. 0 B. 1 C. 2 D. 3

Computer Science & Information Technology

A top-controlled loop is always executed at least once.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology