(This is a version with input of an exercise from Chapter 1.) Write a
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.
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Absolute Java (6th Edition)
Additional Engineering Textbook Solutions
Digital Fundamentals (11th Edition)
Java How To Program (Early Objects)
Starting Out with Programming Logic and Design (4th Edition)
Programming in C
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
- 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 0arrow_forward3. 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 0arrow_forwardWrite a code that determines if a string is a palindrome (can be read forward and backward with the same meaning); e.g. "civic", “elle", “madam" 66 22arrow_forward
- PigLatinStrings converts a string into Pig Latin, but it processes only one word. If a word ends with a punctuation mark in the Pig Latin form, put the punctuation at the end of the string. For example: “Hello!” becomes “ello-Hay!” Source: Mbela, K. (2020) Write a program that prompts the user to input a string and then outputs the string in Pig Latin. Create the program using a Linked List.arrow_forward2. Generate a random string of length 10 that contains only lowercase alphabets from 'a' to 'z'. Print the string in the output.arrow_forwardwrite a program that prompts the user to input a string. then the program uses the function substr to remove all the vo0wels from the stringarrow_forward
- Write a program that prompts the user to entera string, and counts and displays the number of both lowercase and uppercase vowelsin the string.arrow_forwardYour task is to take 2 strings from the user and then check whether All occurrences of a character of a string must be replaced with another character of another string while preserving the order of characters of strings. Your program just print true or false. Programing language: Javaarrow_forwardPART 2:Write a program that accepts as input a sentence in which all the words are run together, but the first character of each word is uppercase. Convert the sentence to a string in which the words are separated by spaces and only the first word starts with an uppercase letter. For example, the string “StopAndSmellTheRoses.” would be converted to “Stop and smell the roses.” If the word is “I”, leave it as an uppercase I. Also check if the sentence ends with a “.”(period). If it does not, add a period at the end of the sentence.You should use a method to perform the editing to the sentence.Print the original sentence and the converted version. You may do this in the method or in the main program, having returned the new string.Repeat this for as many lines as there are in the input file. Use at least 8 lines of data. Have some with only one word. Have some words with only one letter(a), and at least one time the word I in the middle of the sentence. Some should end with a “.” and some…arrow_forward
- Q: Write a program in python that asks the user to enter a word that contains the letter a. The program should then print the following two lines: On the first line should be the part of the string up to and including the the first a, and on the second line should be the rest of the string. Sample output is shown below: Enter a word: buffalo buffa loarrow_forward. Prompt the user for a String. Then prompt the user for a target String. Your program should find each occurrence of that target string in the other String. If the target string is not contained in the other string indicate that to the user. For each occurrence of the target string contained in the other String, display the starting index of the target string, the ending index of the target string, the ASCII character preceding the target string, the ASCII character following the target string. You must find strings that differ only in case. Place this code inside a do-while loop and allow the user to repeat it as many times as they would like. submit your program as an Eclipse .zip project Example of what the program might look like running. This program identifies if a target String is contained within anoteher String.And, if it is there it returns the first occurence of that String.It also identifies the character before the found String and the character after the found…arrow_forwardGreece has capital Athens. Each of the strings 'Greece', and 'Athens' has 6 characters. Show the name and capital where the name and the capital have the same number of characters. You can use the LENGTH function to find the number of characters in a stringarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education