1. Write a menu application that will perform the following tasks: [15 points] Task 1: it...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Write a menu application that will perform the following tasks: [15 points] Task 1: it consists of writing a method, nextMultipleOfTen(), that returns the next multiple of 10 to a given number. If the entered number by the user is negative, your program should print the message "Input Error! Enter a Positive Value". For example: For -25, the program should print "Input Error! Enter a Positive Value". O O For 90, the program should print 100. O For 92, the program should print 100. O For 98, the program should print 100. ● [25 points] Task 2: Write a method, isCrazy(), that tests whether a given number is crazy. A crazy number is a number satisfying two conditions: O Condition 1: it should be a positive number (0 is not included). O Condition 2: its left-most digit should be greater than or equal to 5. ● [10 points] Main method to test your application as given in the following samples of input/output. Samples of Input / Output are below. Press 1 for Task 1, 2 for Task 2 Your Choice? 1 Enter a number: -25 Input Error! Enter a Positive Value. Press 1 for Task 1, 2 for Task 2 Your Choice? 1 Enter a number: 92 Next multiple of 10 to 92 is 100. Press 1 for Task 1, 2 for Task 2 Your Choice? 2 Enter a number: -84 -84 is not a crazy number Press 1 for Task 1, 2 for Task 2 Your Choice? 2 Enter a number: 84 84 is a crazy number Press 1 for Task 1, 2 for Task 2 Your Choice? 2 Enter a number: 48 48 is not a crazy number Press 1 for Task 1, 2 for Task 2 Your Choice? 5 Input Error! Try Again Later [25 points] Write a method with the following header to return an integer reversed: public static int reverse(int number) For example, System.out.prinltn( reverse(3456)); displays 6543. [15 points] Write the methods with the following headers // Return true if number is a palindrome public static boolean isPalindrome(int number) P.S. Use the reverse method to implement isPalindrome. A number is a palindrome if its reversal is the same as itself. [10 points] Main method to test your application as given in the following samples of input/output. run: Enter a number: 23532 in reverse 23532 is: 23532 23532 is palindrome BUILD SUCCESSFUL (total time: 3 seconds) Output - CSCI250LFinalExam3 (run) run: Enter a number: 65352 in reverse 65352 is: 25356 65352 is NOT palindrome BUILD SUCCESSFUL (total time: 7 seconds) 1. Write a menu application that will perform the following tasks: [15 points] Task 1: it consists of writing a method, nextMultipleOfTen(), that returns the next multiple of 10 to a given number. If the entered number by the user is negative, your program should print the message "Input Error! Enter a Positive Value". For example: For -25, the program should print "Input Error! Enter a Positive Value". O O For 90, the program should print 100. O For 92, the program should print 100. O For 98, the program should print 100. ● [25 points] Task 2: Write a method, isCrazy(), that tests whether a given number is crazy. A crazy number is a number satisfying two conditions: O Condition 1: it should be a positive number (0 is not included). O Condition 2: its left-most digit should be greater than or equal to 5. ● [10 points] Main method to test your application as given in the following samples of input/output. Samples of Input / Output are below. Press 1 for Task 1, 2 for Task 2 Your Choice? 1 Enter a number: -25 Input Error! Enter a Positive Value. Press 1 for Task 1, 2 for Task 2 Your Choice? 1 Enter a number: 92 Next multiple of 10 to 92 is 100. Press 1 for Task 1, 2 for Task 2 Your Choice? 2 Enter a number: -84 -84 is not a crazy number Press 1 for Task 1, 2 for Task 2 Your Choice? 2 Enter a number: 84 84 is a crazy number Press 1 for Task 1, 2 for Task 2 Your Choice? 2 Enter a number: 48 48 is not a crazy number Press 1 for Task 1, 2 for Task 2 Your Choice? 5 Input Error! Try Again Later [25 points] Write a method with the following header to return an integer reversed: public static int reverse(int number) For example, System.out.prinltn( reverse(3456)); displays 6543. [15 points] Write the methods with the following headers // Return true if number is a palindrome public static boolean isPalindrome(int number) P.S. Use the reverse method to implement isPalindrome. A number is a palindrome if its reversal is the same as itself. [10 points] Main method to test your application as given in the following samples of input/output. run: Enter a number: 23532 in reverse 23532 is: 23532 23532 is palindrome BUILD SUCCESSFUL (total time: 3 seconds) Output - CSCI250LFinalExam3 (run) run: Enter a number: 65352 in reverse 65352 is: 25356 65352 is NOT palindrome BUILD SUCCESSFUL (total time: 7 seconds)
Expert Answer:
Answer rating: 100% (QA)
import javautilScanner public class Main public static void mainString args S... View the full answer
Related Book For
Quantitative Analysis for Management
ISBN: 978-0133507331
12th edition
Authors: Barry Render, Ralph M. Stair, Michael E. Hanna, Trevor S. Ha
Posted Date:
Students also viewed these programming questions
-
You have been asked to prepare a December cash budget for Ashton Company, a distributor of exercise equipment. The following information is available about the company s operations: The cash balance...
-
According to a published report, 57% of music consumers have paid subscriptions to streaming services. In a group of 196 randomly selected people, what is the expected value and the standard...
-
The following information is available for HTM Corporation's defined benefit pension plan: On January 1, 2017, HTM Corp. amended its pension plan, resulting in past service costs with a present value...
-
A panel of economists provided forecasts of the U.S. economy for the first six months of 2007 (The Wall Street Journal, January 2, 2007). The percent changes in the gross domestic product (GDP)...
-
In Exercise complete the table and use the result to estimate the limit. Use a graphing utility to graph the function to confirm your result. x - 3 lim x3 x - 9 X f(x) 2.9 2.99 2.999 3 ? 3.001 3.01...
-
List the major parts of a complex corporate income statement for WRS Athletic Clubs, Inc., for the year ended December 31, 2007. Include all the major parts of the income statement, starting with net...
-
Assume that today is September 12. You have been asked to help a British client who is scheduled to pay 1,500,000 on December 12, 91 days in the future. Assume that your client can borrow and lend...
-
Noreen is planning to attend a WebEx online meeting today at 11:00 a.m. Her boss has asked her to participate in the meeting with other Petro-Go "Go Points" team leaders from around the world. The...
-
On May 31, O'Hearne Limited had a cash balance per books of $13,126. The bank statement from Community Bank on that date showed a balance of $15,230. A comparison of the bank statement with the...
-
Example 4: A driver on a mountain highway with a 7% downslope notices a traffic sign 850ft ahead in the roadway. The driver strikes the sign at a specd of 30mph. If the driver insists that the 60mph...
-
What are the key checkpoints in the eukaryotic cell cycle, and how do tumor suppressor genes and oncogenes influence cell cycle progression and the development of cancer ?
-
The G. Wolfe Corporation is examining two capital-budgeting projects with 5-year lives. The first, project A, is a replacement project, the second, project B, is a project unrelated to current...
-
A machine packs flour into bags. A random sample of 11 bags was taken and the masses, in grams, of the bags were: 1506.8 1506.6 1506.4 1507.0 1506.3 1507.2 1506.1 1506.8 1507.5 1506.3 1506.4 Provide...
-
Perform the indicated operations and write your result as a single number. (13-5)-34x2+1
-
If the dealer is selling $90 million to the MNC, how much will the MNC pay in pounds
-
A milling machine in a manufacturing facility has a tool change system. The tool changer holds n tools and some duplicate tools may be included. The operator must move through the tools one at a...
-
A consumer magazine is evaluating five brands of trash compactors for their effectiveness in reducing the volume of typical household products that are discarded. In the experiment, each block...
-
For the data in Problem 5-42, develop an exponential smoothing model with a smoothing constant of 0.3. Using the MSE, compare this with the model in Problem 5-42. In Problem 5-42, The following table...
-
List five of the simulation software tools that are available today.
-
Refer to the DJIA data in Problem 5- 39. In Problem 5-39, The following table provides the Dow Jones Industrial Average (DJIA) opening index value on the first working day of 19942013: Develop a...
-
An electromagnet of mass \(1500 \mathrm{~kg}\) is at rest while holding an automobile of mass \(900 \mathrm{~kg}\) in a junkyard. The electric current is turned off, and the automobile is dropped....
-
Derive the equation of motion of the system shown in Fig. 2.84, using the following methods: (a) Newton's second law of motion, (b) D'Alembert's principle, (c) principle of virtual work, and (d)...
-
Draw the free-body diagram and derive the equation of motion using Newton's second law of motion for each of the systems shown in Figs. 2.86. 5k ellee 2r m 44 x(t) 2k FIGURE 2.86 Pulleys connected to...
Study smarter with the SolutionInn App