Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Write a program to:
- Store the following message into a string (DO include periods!):
I am the door of the sheep. All who came before me are thieves and robbers, I am the door. - Insert the following message after the comma in the string.
but the sheep did not listen to them. - Output the string to the screen with a new line at the end.
- Replace the following words in the string.
a. “I” and "me" with “Jesus”
b. “am” with “is”
Note: Make sure you only replace the word “ am“ and not the letters “am" that might appear in that sequence in another word - Output the string with a new line at the end.
The final output should be as follows:
Jesus is the door of the sheep. All who came before Jesus are thieves and robbers, but the sheep did not listen to them. Jesus is the door.
Write in C++
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 3 images
Knowledge Booster
Similar questions
- 3.Use a Python string method for each of these: - determine if a string cost contains only numbers. - return how many times the letter 'e' appears in a string called sentence - return the number of characters in a string tmp 4. Exact Output – EXPLAIN WHAT HAPPENED! sentence = "Hi Bye"; tmp = sentence.split(" "); print(tmp) sentence = “hello!" tmp = sentence.split(" "); print(tmp) 5. Use the Python string method join to - Create a new string that consists of lastName with a comma and a space followed by the firstName %3D firstName = "Sue"; lastName = "Jones" %3D - Create a phone number in the form ###-###-#### out of 3 strings areaCode = "701";_prefix = "477"; lastPart="2339"arrow_forward1. Write a program that reads a number between 1,000 and 999,999 from the user, where the user enters a comma in the input. Then print the number without a comma. Here is a sample dialog; the user input is in color: Please enter an integer between 1,000 and 999,999: 23,456 23456 Hint: Read the input as a string. Measure the length of the string. Suppose it contains n characters. Then extract substrings consisting of the first n - 4 characters and the last three characters.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_forward
- Complete the following program that collects an input word from the keyboard and finds if the word is palindrome. A word is palindrome if the sequence of characters are the same from left-to-right and right-to-left, for example, "dad", "racecar" or "rotor" are all palindrome words because they can be read the same either forward or backward. word = input ("Entera word: ") 1s_palindrome = True i = -1 for if word[j] != word[1]: if not is palindrome: else: i-1 is palindrome = False print ("word is palindrome") jin range(len(word)) i+1 -1 print ("word is not palindrome") len(word) jin wordarrow_forwardTask 3. Remove white spaces and special symbols Program asks user to input a string to remove white spaces and special symbols (dashes, commas and dots). User inputs a string (with several words) and program prints out the input string without white spaces and special symbols. You may use Scan objects and loops. Example: Input a string to remove special symbols: hey, - i like may. Result: heyilikemayarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education