Question: Lab 4 Microsoft Word (we are using codio. Java.) Part 1 Write a program that uses a String and performs different actions on the String.

Lab 4 Microsoft Word

(we are using codio. Java.)

Part 1 Write a program that uses a String and performs different actions on the String. The program will take 2 inputs. the first input will be the String that you will perform some action on. The second input will indicate the action to take (F1, F2, F3, etc.). Part 2 You will need a method for each action. Each method will have the String as a parameter. word count count number of words in the string, print count [F1] character count count number of characters in the string (including spaces), print count [F2] Sentence case capitalize first letter of first word in the string, print new string [F3] lowercase lowercase every letter in the string, print new string [F4] UPPERCASE capitalize every letter in the string, print new string [F5] Capitalize Each Word - capitalize first letter of each word in the string, print new string [F6] sWaP cAsE capitalize every other letter and lower-case alternate letters in the string, print new string [F7]

Example: Enter a String the sky is blue Enter an action F2 Character Count: 15

Enter a String the sky is blue Enter an action F5 THE SKY IS BLUE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!