Absolute Java (6th Edition)
Absolute Java (6th Edition)
6th Edition
ISBN: 9780134041674
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 2PP

(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 create 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 "Airway Avitchsay" and print it.

Blurred answer
Students have asked these similar questions
(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.
Write a single program that allows the user to enter two (2) strings and perform each of the following: Display the length of each string; Concatenate the two strings; and Compare the two strings (if they are equal or not).
3. Capital of the Country by CodeChum Admin I'm a passionate tourist, touring to a lot of countries in the world. I want to go to the capitals of each of the countries since they say they're usually the best. Can you help me find where the capital is? Instructions: Ask the user for a string input From the string inputted, find the index of the capital letter. For this problem, it is guaranteed that there is only 1 capital letter in the inputted string. Hint: Use the isupper(char) function from the ctype.h library to check if a letter is capital or not. Input 1. Input string   Output Enter string: Philippines 0

Chapter 2 Solutions

Absolute Java (6th Edition)

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Computer Programming for Beginners | Functions, Parameters & Arguments | Ep24; Author: Programming With Avelx;https://www.youtube.com/watch?v=VXlh-qJpfw0;License: Standard YouTube License, CC-BY