Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I don't see what's wrong with my switch statement. It's in Java. public int switchCase( int []values) { int sum = 0; switch (sum){ case

I don't see what's wrong with my switch statement. It's in Java.

public int switchCase( int []values) { int sum = 0; switch (sum){ case 1: if(sum == 1) System.out.println("you must subtract 4"); break; case 2: if(sum == 2); System.out.println("you must add 6"); break; case 3: if(sum == 3); System.out.println("you must add6"); break; case 4: if(sum == 4); System.out.println("you must add6"); break; case 5: if(sum == 5); System.out.println("you must add the value"); break; case 6: if(sum == 6); System.out.println("you must add the value"); break; case 7: if(sum == 7); System.out.println("you must add the value"); break; case 8: if(sum < 8) System.out.println("you must add the value * 5"); break; } return sum; }

private boolean sum(int x, int y, int z) { return false; }

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Ehs 2.0 Revolutionizing The Future Of Safety With Digital Technology

Authors: Tony Mudd

1st Edition

B0CN69B3HW, 979-8867463663

More Books

Students also viewed these Databases questions

Question

Repeat Example 18.1 if the air is at 1.5 atm instead of 1.0 atm.

Answered: 1 week ago

Question

4. Why would researchers want to unpackage a cultural difference?

Answered: 1 week ago

Question

3. Identify the methods used within each of the three approaches.

Answered: 1 week ago