The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 2 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Write the code for the following UML diagram
|
NameBuilder |
|
- firstName: String - middleName: String - lastName: String |
|
+ NameBuilder (String first, String middle, String last): + full(): String + formal(): String + initials(): String + lastNameFirst(): String + pigLatin(): String + reverseLast(): String |
Assume input of Eric Patrick Clapton
firstName stores a first name Eric .
middleName stores the middle name Patrick.
lastName stores the last name Clapton.
The constructor initializes all instance variables.
full() returns a new String of the full name. ->Eric Patrick Clapton
formal() returns a new String with first middle initial and last names. Â Â Â ->Eric P. Clapton
initials() returns a new String with all initials. ->E. P. C.
lastNameFirst() return a String with the last name first then comma first name.Clapton, Eric
pigLatin() returns a new String. Take the first letter and move to the end and add ay to both first and last names.   -> ricEay laptonCay
reverseLast() returns a new String that reverses the letters in the last name.   ->notpalC
Create a separate file for class NameBuilderDriver with a main method.
The main method should create an instance of a NameBuilder object calledbuilder with your name passed into the constructor.
Call each method with builder and print out each resulting String.
Properly formatted code with indenting
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll