Question: Write a method that takes an integer and prints One, Two... Nine, Other if the integer is: 1 (or -1), 2 (or -2)... 9

Write a method that takes an integer and prints "One", "Two"... "Nine",

 

Write a method that takes an integer and prints "One", "Two"... "Nine", "Other" if the integer is: 1 (or -1), 2 (or -2)... 9 (or -9), or other, respectively. Use a "switch-case" statement. Problem 4. Write a method that takes three integers a; b and c and returns true if one of b or c is "close" to a (differing from a by at most 1), while the other is "far", differing from both other values by 2 or more. For example, is a = 1; b = 2 and c = 10, then your method should return true.

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 Programming Questions!