Tuesday
Read and solve the exercises found in conditionals
Peer instrcution
Question 1
What are the values of salaryand taxesafter execution of the following code?
double taxes = 50000.0;
double salary = 50000.0;
if (salary > 15000.0) {
taxes = salary * 0.50;
} else {
taxes = salary * 2;
}
salary -= 25000.00;
System.out.println(taxes + ", " + salary);50000.0, 25000.00.0, 0.025000.0, 25000.025000.0.0, 0.0None of the above
Question 2
What are the values of salary and taxes after execution of the following code?
25000.0, 20000.0100000.0, 25000.0100000.0, 50000.025000.0, 15000.0None of the above
Last updated
Was this helpful?