Write a
the program should create a new string with the text "Altway Avitchsay" and print it.
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Absolute Java (6th Edition)
Additional Engineering Textbook Solutions
Artificial Intelligence: A Modern Approach
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Starting Out with Python (3rd Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
Java How To Program (Early Objects)
- (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.arrow_forwardWrite a program that takes a string and swap the first character and the last character of that string.arrow_forwardWrite a program that reads a string from the user containing a date in the form mm/dd/yyyy. It should print the date in the form March 12, 2014.arrow_forward
- Write a program that will analyze a string by counting the number of each alphabetic letter in the stringand then printing a vertical histogram showing the frequency of the letters in the string.For example, if text = "I love problem-solving.", your program should plot when thehistogram is printed: * * * * * * * * * * * * * * * * * * *---------------------------------------------------a b c d e f g h i j k l m n o p q r s t u v w x y zNote that all special characters including blanks are ignored and alphabet letters are caseinsensitive.Create your source code file named Lab10FirstnameLastname.java in NetBeans and add thefollowing menu to the main method in the Lab10FirstnameLastname class.T: Enter a text stringP: Plot alphabetic frequencies in the stringQ: QuitSelect an option:Add the following Histogram class to your source code file and complete the setText(Stringt) and drawHistogram() methods to do the work for options T and P in your main menu.The setText(String t)method changes…arrow_forwardwrite a program that allows the input of a string from the user and prints the longest word in that string and its length. If there are multiple words with the same maximum length you must print the first one only.arrow_forwardWrite a program that gets 2 string variables and 2 integer variables from the user, concatenates (joins them together with no space) and displays the strings, then multiplied the two numbers on a new line and displays them with two decimal points.arrow_forward
- Write a program that asks the user to enter a word that contains the letter a. The programshould then print the following two lines: On the first line should be the part of the string upto and including the first a, and on the second line should be the rest of the string. Sampleoutput is shown below:Enter a word: buffalobuffaloarrow_forwardWrite a program that accepts as input a sentence in which all of 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.”arrow_forwardWrite a program that takes input values as integer, checks the number is not less than 10 (otherwise take input again), and prints the previous 10 numbers i.e. 10, 9, 8, … Concatenate the integer and string values and print as a stringarrow_forward
- Write a program that prompts the user to enter the number of students, the students’ names, and their scores and prints student names in decreasing order of their scores. Assume the name is a string without spaces, use the Scan ner’s next() method to read a name.arrow_forwardWrite a program in Eclipse that prompts the user to enter a string and displays the number of vowels and consonants in the string. Assume letters A, E, I, O, U (or a, e, i, o, u) as the vowels.arrow_forwardWrite a program that reads in a string containing three words separated by commasand then outputs that string with each word in a different line.arrow_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