(This is a version with input of an exercise from Chapter 1.) Write a program thatinputs two string variables, first and last, which the user should enter with his or her name. First, convert both strings to all lowercase. Your program should then cre-ate a new string that contains the full name in pig latin with the first letter capitalized for the first and last name. Use only the pig latin rule of moving the first letter to theend of the word and adding “ay.” Output the pig latin name to the screen. Use thesubstring and toUpperCase methods to construct the new name.For example, if the user inputs “Walt” for the first name and “Savitch” for thelast name, then the program should create a new string with the text “AltwayAvitchsay” and print it.
(This is a version with input of an exercise from Chapter 1.) Write a program that
inputs two string variables, first and last, which the user should enter with his or
her name. First, convert both strings to all lowercase. Your program should then cre-
ate a new string that contains the full name in pig latin with the first letter capitalized
for the first and last name. Use only the pig latin rule of moving the first letter to the
end of the word and adding “ay.” Output the pig latin name to the screen. Use the
substring and toUpperCase methods to construct the new name.
For example, if the user inputs “Walt” for the first name and “Savitch” for the
last name, then the program should create a new string with the text “Altway
Avitchsay” and print it.
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)