Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the Java file NameRearranged.java, write a Java program that reads in a full name and rearranges that name as shown below. The input

In the Java file NameRearranged.java, write a Java program that reads in a full name and rearranges that name

In the Java file NameRearranged.java, write a Java program that reads in a full name and rearranges that name as shown below. The input name must be in the exact format as shown below (Firstname Initial Lastname). If it is not, your code need not work correctly. We will not enter invalid input like having 2 spaces instead of 1 or leaving or give two initials (even though many people have two or more middle names), or have other enhancements like Jr, II, 3rd, Firstname Initial Lastname Rearrange the input name into this format Lastname, Firstname I. Your dialog must look exactly like this when the user enters Mary J Blige. Enter a name in the form of 'First I Last': Mary J Blige Blige, Mary J. eu.jav Hints (use these hints, ignore them, use something else): Assume all inputs are in the correct format: FirstName, space, a one letter initial (no period), a space, and finally the last name Use Scanner's nextLine() method to return the entire line including spaces M M M M A "ABCD".indexOf("BC") returns 1 "ABCDEFG".substring(2, 5) returns "CDE" "ABC" + "DE" evaluates to "ABCDE" In the Java file NameRearranged.java, write a Java program that reads in a full name and rearranges that name as shown below. The input name must be in the exact format as shown below (Firstname Initial Lastname). If it is not, your code need not work correctly. We will not enter invalid input like having 2 spaces instead of 1 or leaving or give two initials (even though many people have two or more middle names), or have other enhancements like Jr, II, 3rd, Firstname Initial Lastname Rearrange the input name into this format Lastname, Firstname I. Your dialog must look exactly like this when the user enters Mary J Blige. Enter a name in the form of 'First I Last': Mary J Blige Blige, Mary J. eu.jav Hints (use these hints, ignore them, use something else): Assume all inputs are in the correct format: FirstName, space, a one letter initial (no period), a space, and finally the last name Use Scanner's nextLine() method to return the entire line including spaces M M M M A "ABCD".indexOf("BC") returns 1 "ABCDEFG".substring(2, 5) returns "CDE" "ABC" + "DE" evaluates to "ABCDE"

Step by Step Solution

There are 3 Steps involved in it

Step: 1

The question youve presented is a programming exercise requiring you to write a Java program that re... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

Solve Var(a+btxt) =

Answered: 1 week ago

Question

Will the company help with relocation expenses?

Answered: 1 week ago