Question: Part 1 CompileTimeErrors , java has a method and 3 tests. The code has several compile time errors. Fix the errors so that the code
Part
CompileTimeErrors java has a method and tests. The code has several compile time errors. Fix the errors so that the code satisfies the following:
method checkNumber
takes a double called myNumber as its parameters
checks if myNumber is positive, negative, or zero, and returns the information as String type.
If positive: the return message should be "The number myNumber is positive."
If negative: the return message should be "The number myNumber is negative."
If zero: the return message should be "The number is zero."
For example, checkNumber returns "The number is positive."
ficld answer: tests the result of checkNumber with argument
field answer tests the result of checkNumber with argument
Field answer : tests the result of checkNumber with argument
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
