Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I write java program using only methods on the first picture to get the results as they appear on the second and third.

How do I write java program using only methods on the first picture to get the results as they appear on the second and third. image text in transcribed
image text in transcribed
image text in transcribed
Here are the seven methods you need to write in addition to your main) method for this program 1. public static int getshift () This method asks the user to enter a shift value between -25 and 25 inclusive, displays a conversion chart for the user to approve, and then returns the shift value only if they approve of the conversion chart thats been displayed. Data validation should occur on the value between -25 and 25 2. public static void getSentences (String sentences[) This method allows the user to enter text into each of the elements of the String array that it receives. (You will probably need to call the nextLine) method of your Scanner once before reading in sentences.) 3. public static void displayOriginal (String sentences) data that it receives, line by line This method displays all of the elements of the array of (element by element) String 4. public static char shiftLetter(char toconvert, int shift This method will shift uppercase letters A through Z shift positions upwards or downwards within the uppercase letters, eg. shift Letter ( . A' , 27 ) returns B' . The same operation also applies for lowercase letters a through z ;e.g. shiftLetterb', -3) returns y.All other characters are returned unchanged; e. shiftLetter(,5) eturs''. 5. public static String convertsentence (String sentence, int shift) This method will do the actual conversion of a string of data to its encoded equivalent in 6-character chunks of data and return the new, encoded String .It should call on the shiftLetter ) method to do the actual character conversion for each individual character. In other words, individual character conversion should not happen within this method. This method doesn't do any output 6. public static void displayEncoded (String sentences, int shift) This method will display in encoded format all of the elements of the array of String data that it receives. It will need to call on the method convertsentence) to convert each string before it displays it. Note that the original array should not be modified with encoded data. 7. public static void displayCombined (Stringt sentences, int shift) This method takes an array of String data and combines all of the String s into a single String that is then processed by the convertSentence() method. The method should essentially display the same results as the displayEncoded) method, except that there won't be separate lines of output but rather one large result instead

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

Students also viewed these Databases questions

Question

What are the purposes of collection messages? (Objective 5)

Answered: 1 week ago