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 1
CompileTimeErrors , java has a method and 3 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 (3.5) returns "The number 3.5 is positive."
ficld answer1: tests the result of checkNumber () with argument 1
field answer 2 tests the result of checkNumber () with argument 0
Field answer 3: tests the result of checkNumber () with argument -10.5
 Part 1 CompileTimeErrors , java has a method and 3 tests.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!