Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this lab you will create a Java program that presents a menu for different tasks. You need to implement the following methods (besides the

 In this lab you will create a Java program that presents a menu for different tasks. You need to implement the following methods (besides the main() method no additional methods are allowed). Prints a sequence of numbers starting at start, no larger than bound, * incrementing by skip. The numbers are printed on a single line. @parar start the starting number (integer) @paran bound the ending number (integer) @paran skip the incrementing number (integer) @return nothing */ public static void printNumbers (int start, int bound, int skip) 33 The method cakes a string and returns the number of lower-case letters in the string. Do not use the count() buil--in method. @param s, the string ww The method takes a String and returns the number of lower-case letters a in the string. Do not use the count   



( built-in method. @param 3, the string @return the count public static int countA(String s) *The method takes a character and a string and return a string that has * the character interleaved after each character in the given string @param c, the character @param 9, the string @return the new string public static String interleave (char c, String 3) The method takes a string and two characters and returns a string in which every occurrence of the first character is replaced by the second one. Do not use the replace() built-in method.



@param 3, the string @param a, the first character @param b, the second character @return a new string public static String replace (Strings, char a char b) This method gets the values for print Numbers and calls it public static void option1() This method gets the values for countA () and calls it W public static void option2 0 This method gets the values for interleave () and calls it public static void option3 () This method gets the values for replace () and calls it public static void option 4 () This method builds the menu, gets the user selection, and


uses a snitch staternentcaliche respective options. The selection should use a 3 Nitch statement. DO public static void menu () Your program' e main() method should have just one onecale menu The menu muer present five opraons as shown aen the Following siguro. Your program's main () method should have just one line to call menu () . The menu must present five options as shown in the following figure. Select an option: 1. Print numbers 2. Count As 3. Interleave 4. Replace 5. Quit The user can select any of those options.




The program must end when the user select\"5. Quit\". If the user selects an option not listed, then the program must let the user know that it was an invalid option, and the menu should be displayed again. For example: 8 You selected 8 Invalid option Select an option: 1. Print numbers 2. Count As 3. Interleave 4. Replace 5. Quit user a menu When the selects correct option then the should call corresponding method for that option. After getting the results for each option the menu should be displayed again. Option 1 1 You selected 1 Write the starting number: 1 write the ending number: 10 write the skip: 2. 1 3 5 7 9 Select an option:


Please help me out on this question






Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions