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
Database Concepts (8th Edition)
Management Information Systems: Managing The Digital Firm (16th Edition)
SURVEY OF OPERATING SYSTEMS
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
- write a program that inserts parentheses, a space, and a dash into a string of 10 user-entered numbers to format it as a phone number. for example 5555555555 becomes (555) 555-5555. If the user does not enter exactly 10 digits, display an error message. continue to accept user input until the user enters 999 using string builder.arrow_forwardWrite a program that asks the user to enter a series of single-digit numbers with nothing separating them. Read the input as a C-string or a string object. The program should display the sum of all the single-digit numbers in the string. For example, if the user enters 2514, the program should display 12, which is the sum of 2, 5, 1, and 4. The program should also display the highest and lowest digits in the string.arrow_forward1. Write a regular expression to find the set of all strings with two consecutive repeated words (e.g., “Humbert Humbert” and “the the” but not “the bug” or “the big bug”) that may occur in a Text. 2. Write a regular expression to find all strings that start at the beginning of the line with an integer and that end at the end of the line with a word in the Text.arrow_forward
- Write a program that prompts the user to enter a string with five lowercase letters and determines whether it is a palindrome.arrow_forward3. Write a regular expression that matches on a string with two vowels in a row followed by the letter "x' or "y". Karrow_forwardQ1: Write a program that asks the user to enter their first name and their last name,separated by a space. Break the input string up into two strings, one containing thefirst name and one containing the last name. You can do that by using the indexOf()subroutine to find the position of the space, and then using substring() to extracteach of the two names. Also output the number of characters in each name andoutput the user’s initials. (The initials are the first letter of the first name togetherwith the first letter of the last name.) A sample run of the program should looksomething like this:Please enter your first name and last name, separated bya space.? Mary SmithYour first name is Mary, which has 4 charactersYour last name is Smith, which has 5 charactersYour initials are MSarrow_forward
- We want to create a program that reads a string and removes from it the characters between two marker characters. For example for the input text: (to buy) We need to buy (i) milk, (ii) eggs, (iii) flour, and (iv) sugar. And using "(" and ")" as the starting and ending markers, the program should output: We need to buy milk, eggs, flour, and sugar. Notice that the number of characters between the markers, and the number of markers present in the string may vary. We will assume that if a starting marker appears in the input text, its corresponding ending marker is also present in the string. Approach: The idea is to copy characters from the input text to an output string variable as long as we have not found the starting marker. From that point on, we ignore the characters in the input text until we find the ending marker. Once we find the ending marker, we resume copying characters to the output string variable, and the process repeats. Drag into the placeholders below the appropriate…arrow_forwardWrite 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 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 first a, and on the second line should be the rest of the string. Sample output is shown below:Enter a word: buffalobuffaloarrow_forward
- I am having a very difficult time writing the code for this particular problem. I've spent some time chipping away at it but can't seem to understand how to incorporate the loop, nor asking the user the angle for all turns.arrow_forwardPrompt for the user to enter their name. Print out their name forwards, backwards, vertically-forwards and vertically-backwards. You will need to declare a String variable, use Scanner to get input of a String, call a String method to isolate one letter and create a loop that traverses the name forwards and backwards. Sample Output: Enter your name: Florene Florene enerolF F l o r e n e e n e r o l F HINTS: Scanner input = new Scanner(System.in); String myName = input.nextLine(); // input is a Scanner object int len = myName.length() // len is the number of characters System.out.println (myName.substring(len-1, len)); // prints last letter I need help with coding the name "Pooja" vertically-forwards and vertically-backwards in java. If you could show me what codes to type in, that would be great. Thank you!arrow_forwardUsing, HTML,CSS , and javascript Write a program that takes as input the speed of a car e.g 80. If the speed is less than 70, it should print “Ok”. Otherwise, for every 5 km/s above the speed limit (70), it should give the driver one demerit point and print the total number of demerit points. For example, if the speed is 80, it should print: “Points: 2”. If the driver gets more than 12 points, the function should print: “License suspended”.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