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 create a condition to ensure that all the years divisible by 4 should contain 29 days in February. Which of the following statements should he use?
A. if (thisYear % 4 === 0) {dayCount[1] = 29;}
B. if (this year/4 === 0) {dayCount[2] = 29;}
C. if (this year*4==0) {dayCount[1] = 29}
D. if (thisYear % 4 <= 29) {dayCount[2] = 29;}
Answer: A
Computer Science & Information Technology
You might also like to view...
Wavy red and green lines that appear below segments of text indicate:
A) a style change from previous text. B) the start of a new paragraph. C) flagged errors. D) presence of formatting marks.
Computer Science & Information Technology
Nonrepudiation is the use of encryption methods to ensure the confidentiality of data.
Answer the following statement true (T) or false (F)
Computer Science & Information Technology