Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ramming (14 points Write a complete Java program in a source file to be named Assignment3.java. The program asks the user for their full name
ramming (14 points Write a complete Java program in a source file to be named Assignment3.java. The program asks the user for their full name (first middle last-using nextline method) as one string in any combination of upper and lower case. Your task is to output the name in the following variations: Print just the initials in upper case letters Print the last name in lower case with the first letter capitalized, followed by a comma and the first name in uppercase case and the middle initial capitalized followed by a period Print the last name comma first name and middle name- all names with first letter capitalized. . . Note: Your program has to print the variations without the middle name. See the sample output below program has to check for middle name and if the user does not have a middle name your Important: You will not get You cannot use the Scanner class for extracting different parts of the name. You have to use the methods in class String do not read the as one line (Use ne Note: The Java API (Application Programming Interface) documentation lists the classes and methods of the Java library. Go to http:/docs oracle comLavase/6/docs/api/and find out the methods you may need to answer the questions. Specifically, you may find some of the following String methods useful: chatAt, concat, contains, indexof, isEmpty, lastIndexof, length, substring, tolowerCase, toupperCase, etc Here is the output your program should produce when the user enters the string shown in RED Sample run 1: What are your first, niddle and last names? Ada Lovelace Your initials are: AL Variation One: Lovelace, ADA Variation Two: Lovelace, Ada Sample run 2: What are your first, niddle and last names? SALLY rachel riDE Your initials are: SRR Variation One: Ride, SALLY Variation Two: Ride, Sally Rachel
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