
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
enter a line of text.
I hate you .
I have rephrased that line to read:
I love you.
you can assume that the word hate occurs in the input. If the word hate occurs more than once in the line, your program will replace only its first occurrence.
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 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Write a program to calculate the surface area and volume of a square pyramid. A square pyramid has a base that is square and all triangle faces are congruent isosceles triangles. (An isosceles triangle is a triangle in which two of the sides are equal. Length of the base: a Height of the pyramid: h Volume = a2h/3 Slant height, s = sqrt(h2 + (a/2)2) This is the Pythagorean Theorem part. Area of one pyramid side = s*a/2 For this program you are to determine two things about a square pyramid. 1) the surface area of the four sides. 2) the volume. Do not include surface area of the base. Test case 1: Height: 5.0' Base: 2.5' Test case 2: Height 2.5 Base: 4.3' The program asks the user to enter the pyramid height (in feet) and length of the base (in feet). Your program will need to determine surface area, and volume by using pythagorean theorem. Your output should neatly show the height, base, total surface area, and volume of the pyramid using 33 decimal place of…arrow_forwardWrite a Java program using at least one for loop that prints pictures of piles of counters of different sizes using ‘=‘ characters as shown below. Each counter should be an odd number of characters wide and be two characters longer than the counter above it. The user should, when asked, type in the size of the top and bottom counters. For example, if the user enters 3 for the top counter and 7 for the bottom counter then the image below should be printed. your program must make use of a counter-controlled for loop be in procedural programming style (not OOP) your program should also be logically correct, solving the core problem, be elegantly written following good style, and be broken into appropriate methods that take arguments and/or return results.arrow_forwardWrite a program to print the lyrics for ten verses of "The Ants Go March-ing." A couple of sample verses are given below. You may choose your own activity for the "little one" in each verse, but be sure to choose somethingthat makes the rhyme work (or almost work). The ants go marching one by one, hurrah! hurrah!The ants go marching one by one, hurrah! hurrah!The ants go marching one by one,The little one stops to suck his thumb,And they all go marching down ...In the ground ...To get out ....Of the rain.Boom! Boom! Boom!The ants go marching two by two, hurrah! hurrah!The ants go marching two by two, hurrah! hurrah!The ants go marching two by two,The little one stops to tie his shoe,And they all go marching down ...In the ground ...To get out ...Of the rain.Boom! Boom! Boom!arrow_forward
- Create a program which will read a phrase from the user and create a framed version of it for printing. For example, the phrase "hello world"would result in: ********* * hello * * world * ********* Whereas the phrase "the sky is falling"might be: *********** * the * * sky * * is * * falling * *********** Or: *********** * the * * sky * * is * * falling * *********** Or even: *********** * the * * sky * * is * * falling * *********** Depending on whether or not the user asked for left, centered, or right justification — respectively — of the phrase's words within the frame. Note how the frame exactly fits the phrase based on the longest word within. Neat, eh? The phrase "O | -+- | /-\"when centered would become: ******* * O * * | * * -+- * * | * * /-\ * ******* (Okay, so it's a sad excuse for a stick figure, but hey! I've never claimed to be a great good decent artist, now…arrow_forwardWrite a program that finds word differences between two sentences. The input begins with the first sentence and the following input line is the second sentence. Assume that the two sentences have the same number of words. The program displays word pairs that differ between the two sentences. One pair is displayed per line. Ex: If the input is: Smaller cars get better gas mileage. Tiny cars get great fuel economy then the output is: Smaller Tiny better great gas fuel mileage economy Hint: Store each input line into a list of strings. 461710,3116374.qx3zqy7arrow_forwardWrite a program that takes 10 random numbers from 1 to 12 inclusively and averages them together.arrow_forward
- java Use a loop to print the alphabet from A to Z. Print all the characters in one line, with no spaces between them. Also use another loop to print the alphabet from z to a. Print all the character in one line, with no spaces between them. Note: There will be two lines in the output. One of the uppercase letters from A to Z, and a second line for the lowercase letter from z to a.arrow_forwardWrite a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. Ex: If the input is -15 30, the output is: -15 -5 5 15 25 Ex: If the second integer is less than the first as in 20 5, the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last.arrow_forwardWrite a program that prints the numbers from 1 to 100 (inclusive), one per line. However, there are three special cases where instead of printing the number, you print a message in its place:1. If the number you would print is divisible by 3, print the message: Better three hours too soon than a minute too late.2. If the number you would print is divisible by 5, print the message: Where do you see yourself in five years?3. If the number you would print is divisible by both 3 and 5, instead print out: In the future, everyone will be world famous for 15 minutes.Make sure to print the exact strings given above!arrow_forward
- Censorship. Create a program that reads text, and produces a new output text in which all four-letter words are replaced with "****". For example, for input “The class was easy”, the program outputs “The was “.arrow_forwardWrite a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is either heads or tails. Assume the input is a value greater than 0. Ex: If the input is: 3 the output is: headstailsheads For reproducibility needed for auto-grading, seed the program with a value of 2. In a real program, you would seed with the current time. In that case, every program's output would be different, which is what is desired but can't be auto-graded. Note: A common student mistake is to call srand() before each call to rand(). But seeding should only be done once, at the start of the program, after which rand() can be called any number of times. Your program must define and call the following function that randomly picks 0 or 1 and returns "heads" or "tails". Assume the value 0 represents "heads" and 1 represents "tails".string HeadsOrTails() #include <iostream>#include <cstdlib>using namespace std; /* Define your function here */…arrow_forwardDesign a program that simulates the slot machine game. When the program starts, it should greet user and then start the game. For each game, the program asks user for the bet amount, and then randomly picks three words/images. If all the three words/images are same, user won three times of the bet amount, if any two of them are same, user won twice of the bet amount, otherwise, user won 0. The program should allow user to play as many games as wanted at one run. The program should display number of games user played, total amount bet and won at the end the program. It should also display each game's information, including game number, bet amount, the three words/images, and won amount. Here is the list of words you may use: Cherries, Oranges, Plums, Bells, Melons, and Bars. i need to do this in raptor flowchartarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
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