![joytheqt](/avatars/633.jpg)
joytheqt
07.06.2021 •
Computers and Technology
The following method is intended to return true if and only if the parameter val is a multiple of 4 but is not a multiple of 100 unless it is also a multiple of 400. The method does not always work correctly public boolean isLeapYear(int val) if ((val 4) == 0) return true; else return (val & 400) == 0; Which of the following method calls will return an incorrect response?
A .isLeapYear (1900)
B. isLeapYear (1984)
C. isLeapYear (2000)
D. isLeapYear (2001)
E. isLeapYear (2010)
Solved
Show answers
More tips
- A Animals and plants What Do Terriers Eat?...
- F Food and Cooking Discover the Benefits and Properties of Dates...
- C Computers and Internet Dynamically Assigned IP Address: What Is It and How Does It Work?...
- S Style and Beauty How to Get Rid of Acne: Scientifically Proven Methods...
- H Health and Medicine Simple Ways to Lower Cholesterol in the Blood: Tips and Tricks...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
- L Leisure and Entertainment History of International Women s Day: When Did the Celebration of March 8th Begin?...
- S Style and Beauty Intimate Haircut: The Reasons, Popularity, and Risks...
- A Art and Culture When Will Eurovision 2011 Take Place?...
- S Style and Beauty How to Choose the Perfect Hair Straightener?...
Answers on questions: Computers and Technology
- C Computers and Technology Cara is cleaning her computer when she notices a loose cable connecting to her printer. Which two ports would the cable most likely fit? HDMI DisplayPort Accelerated Graphics...
- B Business All of the following statements regarding vertical analysis are true except a.in a vertical analysis of a balance sheet, each asset item is stated as a percent of total assets...
- H History Earths Cycles (Water, Carbon, ) 7 of 19 15:55/33:00 A glass of ice water is shown below before and after it reaches room temperature. Which st - atement explains something...
- P Physics A truck with a mass of 1370 kg and moving with a speed of 12.0 m/s rear-ends a 593 kg car stopped at an intersection. The collision is approximately elastic since the car is...
- E English When Juliet arrives in the Friar’s cell, she threatens to stab herself. What does his mirror from earlier in the play?...
- E English Which of the following is the correct order to access courses directly from the dashboard...
- M Mathematics Drop snaps , trynna make new friends :(...
- M Mathematics What is the value of b and the value of c? Picture of triangle down below. b= c=...
- C Chemistry A rigid oxygen-tank contains 59.9 psi of O2 at room temperature (25°C). What temperature should the tank be at (in Celsius) for the pressure of O2 to be 767.1 kPa? (1 atm-...
- C Chemistry Please help me with these questions...
Ответ:
.isLeapYear (1900) will return an incorrect response
Explanation:
Given
The above method
Required
Which method call will give an incorrect response
(a) will return an incorrect response because 1900 is not a leap year.
When a year is divisible by 4, there are further checks to do before such year can be confirmed to be a leap year or not.
Since the method only checks for divisibility of 4, then it will return an incorrect response for years (e.g. 1900) that will pass the first check but will eventually fail further checks.
Hence, (a) answers the question;
Ответ: