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
-
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...
-
Tern Corporation manufactures a motor scooter at a cost of $5,000 and sells it to Snipe Corporation for $7,000. Snipe spends $2,000 marketing the scooter and sells it to the general public for...
-
Central School District is awarded a $400,000 federal grant to implement and test a new way of teaching middle school math. The award stipulates that the district must provide a 20 percent match. a....
-
If your instructor assigns a marketing plan for your class, we hope you will be excitedfor two reasons. First, you will get insights into trying to actually do marketing that often go beyond what you...
-
Purchases Recorded Gross and Net some of the transactions of Torres Company during August are listed below. Torres uses the periodic inventory method. August 10 Purchased merchandise on account,...
-
A library contains a flip-flop named FF1 (shown below) with a setup time of 20 ps, hold time of 10 ps, clock-to-Q delay of 10 ps. FFI A designer made another flip-flop FF2 by reusing FF1 and adding...
-
Crane Library, a nonprofit organization, presented the following statement of financial position and statement of activities for its fiscal year ended February 28, 2024. Assets Current Assets Cash...
-
Galactic Inc. manufactures flying drone toys. Sales units for January, February, March, April and May were 420, 400, 472, 432, and 500 respectively. Each unit requires 3 direct labor hours and...
-
Describe a quantitative research project you would be interested in starting now or in the near future. Explain the problem and why this would be important for you to study? Why is a quantitative...
-
Describe budgeting choices around obesity app development and specific costs. Be sure to include sources to validate the proposed costs.
-
Describe the role of population-level health in reducing/increasing the costs of healthcare at the individual level. Unlike other discussions, you do not need to comment on another student's post....
-
Describe the strategic leadership of a successful CEO(s) in the organization's history and how this leadership has affected the strategy of the organization and contributed to its organizational...
-
Describe the work involved in planning procurement for projects, including determining the proper type of contact to use and preparing a procurement management plan, statement of work, source...
-
Here are your three annual salary amounts for each loan and the monthly payment amounts paid per loan. 1.) $29,200 in student loans at 5.6% interest. You plan to pay this off over 15 years * annual...
-
r = 0.18 Find the coefficients of determination and non-determination and explain the meaning of each.
-
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...
-
Are there any activities in a family that you believe should be allocated by a market? What characteristics do those activities have?
-
What is the difference between socialism in theory and socialism in practice?
-
Into what three sectors are market economies generally broken up?
Study smarter with the SolutionInn App