Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You notice some co-worker's code is both not working and is overly complicated. The code should act in the following way: if value is greater

image text in transcribedimage text in transcribed

You notice some co-worker's code is both not working and is overly complicated. The code should act in the following way: if value is greater than or equal to 21, isover21 should return true otherwise, isover21 should return false Simplify the following code: Hint: think about how many lines of code are really needed to accomplish what needs to be done. = 1 public boolean isover21(int value) { 2 boolean bool false; 3 if (value > 40) { 4 bool = false; 5 } else if (value >= 40 && value >= 21) { 7 bool true; 8 } 9 else { bool = true; 11 } 12 return bool; 13} 14 6 000 om 10

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

More Books

Students also viewed these Databases questions