Question: Please write this in java and show the output 1. Page 1 Part 1 Write a program that uses a String and performs different actions


Please write this in java and show the output
1. Page 1 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 str ng print new string [F4] UPPERCASE- capitalize every letter in the string, print new sting IFS . 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 sy is blue Enter an action F5 THE SKY IS BLUE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
