Answer:
.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;
Which XXX declares a student's name. public class Student { XXX private double myGPA; private int myID; public int getID() { return myID; } } Group of answer choices String myName; public String myName; private myName; private String myName;
Which XXX declares a student's name.
public class Student {
XXX
private double myGPA;
private int myID;
public int getID() {
return myID;
}
}
Group of answer choices
a. String myName;
b. public String myName;
c. private myName;
d. private String myName;
Answer:private String myName;
Explanation:To declare a student's name, the following should be noted.
i. The name of the student is of type String
ii. Since all of the instance variables (myGPA and myID) have a private access modifier, then myName (which is the variable name used to declare the student's name) should be no exception. In other words, the student's name should also have a private access.
Therefore, XXX which declares a student's name should be written as
private String myName;
Option (a) would have been a correct option if it had the private keyword
Option (b) is not the correct option because it has a public access rather than a private access.
Option (c) is not a valid syntax since, although it has a private access, the data type of the variable myName is not specified.
Option (d) is the correct option.
what are the different steps while solving a problem using computer? explain
Explanation:
The following six steps must be followed to solve a problem using computer.
Problem Analysis.
Program Design - Algorithm, Flowchart and Pseudocode.
Coding.
Compilation and Execution.
Debugging and Testing.
Program Documentation.