Question

In: Computer Science

Create the logic for a rhyming program that takes in five words from a user input...

  1. Create the logic for a rhyming program that takes in five words from a user input and replaces the selected rhyming words with the user's input, then creates and displays the Humpty Dumpty rhyme with the five words from the user input.

Hint:

1. You will use the sentinel values: start and stop

2. The program will ask the user for 5 words.

3. The program will store the 5 words

4. The program outputs the rhyme replacing the ____ with the words provided by the user. (Remember, the program doesn't know what words will be entered, but it will store it in order to display them in the rhyme.

5. The output statement will display the rhyme with the user's inputs.

Humpty Dumpty sat on a  ------,

Humpty Dumpty had a great -----l;

All the king's ----- and all the king's -----

Couldn't put Humpty Dumpty  ----- again.

Solutions

Expert Solution

C++ Program for this problem is -

#include <iostream>
using namespace std;
int main()
{
cout<<"Start\n";
string word1,word2,word3,word4,word5;
cout<<"Enter first Word : ";
cin >>word1 ;
cout<<"Enter second Word : ";
cin >>word2 ;
cout<<"Enter third Word : ";
cin >>word3 ;
cout<<"Enter fourth Word : ";
cin >>word4 ;
cout<<"Enter fifth Word : ";
cin >>word5 ;
cout<<"\nHumpty Dumpty sat on a "<<word1<<"\nHumpty Dumpty had a great "<<word2<<"\nAll the king's "<<word3
<<"\nand all the king's "<<word4<<"\nCouldn't put Humpty Dumpty "<<word5 <<" again\n";
cout<<"\nStop";
return 0;
}


Related Solutions

C Program: Create a C program that prints a menu and takes user choices as input....
C Program: Create a C program that prints a menu and takes user choices as input. The user will make choices regarding different "geometric shapes" that will be printed to the screen. The specifications must be followed exactly, or else the input given in the script file may not match with the expected output. Important! Consider which control structures will work best for which aspect of the assignment. For example, which would be the best to use for a menu?...
C Program: Create a C program that prints a menu and takes user choices as input....
C Program: Create a C program that prints a menu and takes user choices as input. The user will make choices regarding different "geometric shapes" that will be printed to the screen. The specifications must be followed exactly, or else the input given in the script file may not match with the expected output. Your code must contain at least one of all of the following control types: nested for() loops a while() or a do-while() loop a switch() statement...
USE C++ for following problem and also use create full program that takes input from user...
USE C++ for following problem and also use create full program that takes input from user also do not use loops only recursion and try to keep program simple A palindrome is any word, phrase, or sentence that reads the same forwards or backwards. Here are some palindromes: Level Civic Pot top A man a plan a canal Panama Write a boolean function that determines if a string argument is a palindrome. The function should return true if the argument...
write a program that takes the input value from the user and calculate the sum from...
write a program that takes the input value from the user and calculate the sum from that number to zero in MIPS
Write a program that takes a string input from the user and then outputs the first...
Write a program that takes a string input from the user and then outputs the first character, then the first two, then the first three, etc until it prints the entire word. After going up to the full word, go back down to a single letter. LastNameUpDown. Input: Kean Output: K Ke Kea Kean Kea Ke K
Q1-      Write a program that takes a list of values as an input from the user....
Q1-      Write a program that takes a list of values as an input from the user. The program should further ask the user about sorting the list in ascending or descending order. It is desirable to use Arraylist/Vector in place of simple arrays. (Object Oriented Programming java)
Create a JavaScript program that asks for the input of at least five words (a total...
Create a JavaScript program that asks for the input of at least five words (a total of 25+ characters) string from a user and performs the following functions to it: STRING METHODS Check to see if the string input meets the 25+ character limit. If it does not, send a message and ask for another string. Output the original string as it was entered onto the web page document. Output the original string in all lower case letters. Do not...
IN C++. Objective: Create a Singly linked list of numbers based upon user input. Program logic:...
IN C++. Objective: Create a Singly linked list of numbers based upon user input. Program logic: Ask for a number, add that number to the front of the list, print the list. Repeat until they enter -1 for the number. . Sample Input: 10, 15, 5, 2, 4, -1 Output: 4, 2, 5, 15, 10. Next sort all the numbers using selection sort and display them. Next give the user option to search for a specific number in the list....
IN C++. Objective: Create a Singly linked list of numbers based upon user input. Program logic:...
IN C++. Objective: Create a Singly linked list of numbers based upon user input. Program logic: Ask for a number, add that number to the front of the list, print the list. Repeat until they enter -1 for the number. . Sample Input: 10, 15, 5, 2, 4, -1 Output: 4, 2, 5, 15, 10. Next sort all the numbers using selection sort and display them. Next give the user option to search for a specific number in the list....
write a program that takes two input values from the user and calculate the division if...
write a program that takes two input values from the user and calculate the division if the first number is greater than the second one otherwise calculate the multiplication.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT