Question
public static void findNextBirthday(int bmonth, int bday) { // assume this method is defined properly } // How would a programmer properly call on the
public static void findNextBirthday(int bmonth, int bday)
{
// assume this method is defined properly
}
// How would a programmer properly call on the method above?
Group of answer choices
1-findNextBirthday(2,4);
2-Scanner.findNextBirthday(x,y);
3-date = findNextBirthday();
4-findNextBirthday("February", 4);
How can a single if structure evaluate multiple expressions?
Group of answer choices
1 An if structure must use constants
2 There are several ways that this can happen: using else if, && and ||
3 An if structure does not evaluate expressions, it is used for prompting
4 An if structure can only evaluate a single expression
Which best describes the char data type?
Group of answer choices
a char contains values A-Z or a-z and is non-numeric
a char is a primitive data type and is assigned a value using single quotes ' '
a char is a String, but with a length of 1
a char is a result of overcooking user input
Describe the purpose of Scanner and the methods associated with it.
(A good answer would be 3-5 complete sentences and may include an example - syntax-perfect code is not expected)
// assume that this code is in the proper class/method setting
public static final int startPoint = 10;
for(int count = startPoint, count >= 0, count--)
{
System.out.println(count + "!");
}
// Which best describes the code snippet above?
Group of answer choices
The for loop should use ; to separate its 3 sections instead of ,
The line with "public static final" will not work. A final int is not valid.
This is a loop that counts down from the startPoint constant down to zero
The line with the println statement will not work. You cannot combine an int and string with +
What does a JAVA object contain?
Group of answer choices
methods and data
objective data and subjective data
parameters and return
numeric data and text data
// assume that this code is in the proper class/method setting and GME is a defined integer
if(GME < 0)
{
System.out.println("done")
}
if(GME > 0 && GME < 1000)
{
System.out.println("hold")
}
if(GME >= 1000)
{
System.out.println("profit")
}
// What is true about the code above?
Group of answer choices
This code would run, but would give a warning for using &&
This code would run, but would be better structured using "else if"
This code would not run - this comparison should be done in a loop
This code would not run - an int like GME cannot be compared using <
Which of the following best describes a parameter?
Group of answer choices
a parameter is a value sent back from a method to the location that called
a parameter is a value that is final and accessible anywhere in a class
a parameter is a value sent into a method
a parameter is a value that accumulates other values, usually inside of a loop
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started