Question: Java 2. Complete Program2 that accepts some words from the end user and creates an acronym from those words. Allow for multiple spaces to appear
2. Complete Program2 that accepts some words from the end user and creates an acronym from those words. Allow for multiple spaces to appear between words. The acronym comprises the first letter of each word and is all uppercase followed by a period. For instance if the user entered ordinary wizarding level then the acronym is O.W.L. Your program must: - include a method called formAcronym that accepts a string and returns the acronym use the split method - validate that more than 1 word is entered: your program must throw an exception if the method argument is invalid import java.util.Scanner; import java.lang.IllegalArgumentException; public class Program2 { public static void main(String[] args); Scanner kb = new Scanner (System.in); System.out.println("Enter some words: "); 3. An anagram is a word, phrase, or name formed by rearranging the letters of another, such as cinema, formed from iceman. Complete Program that checks if 2 words are anagrams of each other. Your program must use toCharArray and include a method checkIfAnagram that accepts 2 strings and displays the result. import java.util.Arrays; public class Program3 { public static void main(String[] args) { checkIfAnagram("iceman", "cinema"); checkIfAnagram ("notananagram", "notachance"); / add checkIfAnagram method here
Step by Step Solution
There are 3 Steps involved in it
Program2 Create an Acronym To create a program that generates an acronym from user input we will include a method called formAcronym which will handle ... View full answer
Get step-by-step solutions from verified subject matter experts
