Answered step by step
Verified Expert Solution
Question
1 Approved Answer
q1. What will the following code print out when it is run? public static double add(int a, double b) { return a + b +
q1.
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
q2.
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