Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that generates scrambled from one or more words provided by the user Step 1: Input You will prompt the user to enter

image text in transcribed
image text in transcribed
Write a program that generates scrambled from one or more words provided by the user Step 1: Input You will prompt the user to enter a word to be scrambled. Step 2: Calculation. Write a method private static String Scramble (String word) that constructs a scrambled version of a given word, randomly flipping two characters other than the first and last one. Helpful hints: We can use the substring method to help us change the value of a character in a string. For example, let's say we want to change the 5 character (i.e, the character at index 4) of myName to the character x: String myiae "aymond": myNane-EyNane.substring (0,4)+'1% rysame.zubatring (5); step 3: Output. The program will print out the scrambled version of the word provided by the user, and then prompt the user to enter another word If the user is finished, they can indicate that they are ready to stop the program. If the user wants to continue entering words to scramble, the program should loop back to Step 1 Example program run: Enter a word to scramble: pickle Scrambled word: pkcile Would you like to enter another word to scramble? (Y/N) Invalid response: y Would you like to enter another word to scramble? (Y/N) Enter a word to scramble: Scranbled word: a Would you like to enter another word to scramble? (Y/N) Invalid response: do Would you like to enter another word to scramble? (Y/N) Enter a word to scranble: dog Scranbled word: dog Would you like to enter another word to scramble? (Y/N) Enter a word to scranble: dogs Scranbled word: dgos Would you like to enter another word to scramble? (Y/N) Enter a word to scramble: Orlando Scrambled word: Oralndo Would you like to enter another word to scramble? (Y/N) Word Scramble Designing, developing, and Testing Your Program Developing software is a process, you need to be following the steps: 1. Develop an algorithm to solve your problem. 2. Convert your algorithm into pseudocode 3. Develop test data and hand calculate the results. 4. Test your pseudocode against your test data. Did you get correct results? No, revisit algorithm development Paste your pseudocode into your program file, and comment it out. This will be used as the structure of your program. Place your Java code under your pseudocode steps 5. ell commented program, just by using your pseudocode as guide for your programming 6. IMPORTANT: Do not try to implement the full solution at once. Take it in small steps, testing yourself for correctness before moving on to the next step. Test your program against your test data. 7. Debugging Your Program Set a breakpoint at the first statement past the statement that you use to input from the in the margin to the left of the line number next to that the Progo3 TaxCalc project in the Project Explorer tab. Then select Debug As Java Application. Your program will run until the breakpoint and stop. user by clicking statement. Start the program by right clicking on in the Variables tab in the pane to the right of your code, you will see the variable that has stored the the values of variables changing in the Variables tab input value from the user. You can step through you code by pressing the F5 key. As you do, you will see f you want to keep track of a particular variable, you can watch" the veriable. To do this, right click on the variable Name in the Variables tab. Select the "watch" option. It will add the variable to the set of watched variables in the Expressions tab alongside the Variables tab, As you step through your code in the debugger, the Expressions tab will show the current value of the variables at that statement. This is very helpful when debugging your program. Archive the Program After you have completed your program, you need to zip it and upload it to Moodle

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

How To Make A Database In Historical Studies

Authors: Tiago Luis Gil

1st Edition

3030782409, 978-3030782405

More Books

Students also viewed these Databases questions

Question

Does it avoid using personal pronouns (such as I and me)?

Answered: 1 week ago

Question

Does it clearly identify what you have done and accomplished?

Answered: 1 week ago