Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write and use the following functions in your program: showMenu(): displays the menu for the user to see options getChoice (): allows the user to

image text in transcribed
Write and use the following functions in your program: showMenu(): displays the menu for the user to see options getChoice (): allows the user to choose an option from the menu, printNthChars (): returns a string containing every n^th character in the argument string Example: f("astronaut. 3) rightarrow" tnt" invertHalves (): returns a string with the first half of the argument string reversed, followed by the second half of the argument string reversed. The central character should remain in place, if applicable. Example: f("example") rightarrow "axemelp" scramble (): returns the characters of the argument string in a random order. (The output of this function should be different every time the program is executed.) Example: f("sonic") rightarrow "sicon" rightarrow "cosni" repartition () returns the argument string, split evenly into n parts (separated by slashes) If the string cannot be split into equal length parts, the central section should contain the extra characters f("programmatically" 5) rightarrow "pro/gra/mmat/ica/lly" replaceChars (): replace all instances of a random character in the first argument string with a random character from the second string. Do the same thing to the second string and make both strings available to the calling interface, f("probably", "likely") rightarrow "prokakly' "bikeby' No input or output should occur inside these functions. The program should have a menu-driven interface. The user should be able to choose a function by name or number, Once chosen, the program should prompt the user for the appropriate number of arguments, then call the function. If the string is not at least 5 characters long, reject it and ask for another, Once the function is complete, print the results-again, not inside the function body, Prompt the user to decide whether the menu should be shown again

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_2

Step: 3

blur-text-image_3

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

3. An overview of the key behaviors is presented.

Answered: 1 week ago

Question

2. The model is credible to the trainees.

Answered: 1 week ago