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
- In this assignment you will write a program that shows the valid moves of chess pieces. Your program will draw a board with 64 squares using the traditional layout, next ask the user to choose a move, and then, depending on the user's choice, redraw the board with the selected chess piece and its valid moves. Please see the examples of valid moves of chess pieces and the traditional chess board layout below:arrow_forwardWrite a program that prompts the user for a month name and a month day. Your program will examine the month and the day to determine the season. Your program will then display the date's season (Winter, Spring, Summer or Autumn). The input is a string to represent the month and an int to represent the day. See chart below for the range of dates within seasons. Ex: If the input is: April 11 the output is: Spring The dates for each season in the northern hemisphere are:Spring: March 20 - June 20Summer: June 21 - September 21Autumn: September 22 - December 20Winter: December 21 - March 19arrow_forward3. Write a regular expression that matches on a string with two vowels in a row followed by the letter "x' or "y". Karrow_forward
- Q1: 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_forwardWe 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_forward
- Write 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_forwardDeclare a string variable that has the word "TEST" in it 500 times.arrow_forwardThe Fibonacci series is a series that begins with 0 and 1 and has the property that each succeeding term is the sum of the two preceding terms. For example, the third Fibonacci number is 1 which is sum of 0 and 1. The next is 2, which is a sum of 1 + 1. Write a program that displays the first ten numbers in a Fibonacci series.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