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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started