Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. How many zeros will be printed out to the console when this code runs? switch( 4 ) { case 2: System.out.print( 0 ); break;
1.
How many zeros will be printed out to the console when this code runs?
switch( 4 ) { case 2: System.out.print( 0 ); break; case 3: System.out.print( 0 ); case 4: System.out.print( 0 ); case 5: System.out.print( 0 ); break; default: System.out.print( 0 ); break; }
Group of answer choices
4
2
1
3
q2.
What should RETURN_TYPE be:
public static RETURN_TYPE methodA(int count, String name, double distance, char grade, boolean done) { done = !done; String upperCaseName = name.toUpperCase(); double length = distance; int counter = count + 1; return "length:" + length; }
Group of answer choices
int
char
String
double
boolean
q3.
What will the following code print out when it is run?
public static double add(int a, double b) { return a + b + 3; } public static double add(double a, int b) { return a + b + 1; } public static double add(int a, int b) { return a + b + 2; } public static void main(String[] args) { int a = 4; double b = 3.2; System.out.print(add(b, a)); }
Group of answer choices
7.2
8.2
9.2
10.2
q4.
What will print out?
double num1 = 2.4; double num2 = 0.4; if ( num2 - num1 < 0.01) { System.out.println("close enough to equal"); } else { System.out.println("not close enough to equal"); }
Group of answer choices
not close enough to equal
close enough to equal
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