bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 3, Problem 25PC

Word Game

Write a program that plays a word game with the user. The program should ask the user to enter the following:

• His or her name

• His or her age

• The name of a city

• The name of a college

• A profession

• A type of animal

• A pet’s name

After the user has entered these items, the program should display the following story, inserting the user’s input into the appropriate locations:

There once was a person named NAME who lived in CITY. At the age of AGE, NAME went to college at COLLEGE. NAME graduated and went to work as a PROFESSION. Then, NAME adopted a(n) ANIMAL named PETNAME. They both lived happily ever after!

Blurred answer
03:47
Students have asked these similar questions
9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this:     Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point.     After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data:     A trivia question     Possible answer 1     Possible answer 2     Possible answer 3     Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…
9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this:     Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point.     After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data:     A trivia question     Possible answer 1     Possible answer 2     Possible answer 3     Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…
1. [LO 1, LO 2, LO 3 & LO 4, Treasure Hunter Description You are in front of a cave that has treasures. The cave can be represented in a grid which has rows numbered from 1 to , and columns numbered from 1 to . For this problem, define (x,y ) as a tile that is in the the-x row and the y-row. There is a character in each tile, which indicates the type of that tile. Tiles can be floors, walls, or treasures which are represented respectively by the characters '.' (period), '#' (hashmark), and '*' (asterisk). You can go through the floor tiles and treasures, but you can't get past the wall tiles.Initially, you are in a tile (??, Sy). You want to visit all the treasure squares, and retrieve the treasure. When you visit a treasure tile, the treasure is instantly retrieved, and the tile turns into a floor.In a move, if you are on a tile (?,y), then you can move to the right tile above (?-1,y), right (?,y + 1), down (? + 1, ), and left (?, 1) of the current tile. The tile you visit must…

Chapter 3 Solutions

Mylab Programming With Pearson Etext -- Access Card -- For Starting Out With C++: From Control Structures Through Objects, Brief Version

Ch. 3.5 - Assume the following variable definitions: int a =...Ch. 3.5 - Complete the following program skeleton so it asks...Ch. 3.5 - Prob. 3.13CPCh. 3.6 - Write a multiple assignment statement that assigns...Ch. 3.6 - Write statements using combined assignment...Ch. 3.6 - Prob. 3.16CPCh. 3.7 - Write cout statements with stream manipulators...Ch. 3.7 - Prob. 3.18CPCh. 3.7 - The following program skeleton asks for an angle...Ch. 3.9 - Prob. 3.20CPCh. 3.9 - Assume the variables angle1 and angle2 hold angles...Ch. 3.9 - To find the cube root (the third root) of a...Ch. 3.9 - The cosecant of the angle a is 1sina Write a...Ch. 3 - Assume the following variables are defined: int...Ch. 3 - Prob. 2RQECh. 3 - Prob. 3RQECh. 3 - Complete the following table by determining the...Ch. 3 - Write C++ expressions for the following algebraic...Ch. 3 - Assume a program has the following variable...Ch. 3 - Assume a program has the following variable...Ch. 3 - Assume qty and salesReps are both integers. Use a...Ch. 3 - Rewrite the following variable definition so that...Ch. 3 - Complete the following table by providing...Ch. 3 - Write a multiple assignment statement that can be...Ch. 3 - Write a cout statement so the variable divSales is...Ch. 3 - Write a cout statement so the variable totalAge is...Ch. 3 - Prob. 14RQECh. 3 - The__________ library function returns the cosine...Ch. 3 - The ___________ library function returns the sine...Ch. 3 - The ________ library function returns the tangent...Ch. 3 - The __________ library function returns the...Ch. 3 - The _________ library functionreturns the...Ch. 3 - The _________ library function returns the natural...Ch. 3 - Prob. 21RQECh. 3 - The _______ library function returns the value of...Ch. 3 - The _________ libraryfunction returns the square...Ch. 3 - The ________ file must beincluded in aprogramthat...Ch. 3 - A retail store grants its customers a maximum...Ch. 3 - Write a pseudocode algorithm for a program that...Ch. 3 - Write a pseudocode algorithm for a program that...Ch. 3 - using namespace std; int main () { double number1,...Ch. 3 - #include iostream using namespace std; int main()...Ch. 3 - #include iostream; using namespace std; int main()...Ch. 3 - #include iostream; using namespace std; main { int...Ch. 3 - #inc1ude iostream; using namespace std; main {...Ch. 3 - #inc1ude iostream; using namespace std; int main()...Ch. 3 - What will each of the following programs display?...Ch. 3 - #include iostream using namespace std; int main()...Ch. 3 - (Assume the user enters George Washington.)...Ch. 3 - (Assume the user enters 36720152. Use a...Ch. 3 - Miles per Gallon Write a program that calculates a...Ch. 3 - Stadium Seating There are three seating categories...Ch. 3 - Test Average Write a program that asks for five...Ch. 3 - Average Rainfall Write a program that calculates...Ch. 3 - Male and Female Percentages Write a program that...Ch. 3 - Ingredient Adjuster A cookie recipe calls for the...Ch. 3 - Box Office A movie theater only keeps a percentage...Ch. 3 - How Many Widgets? The Yukon Widget Company...Ch. 3 - How Many Calories? A bag of cookies holds 30...Ch. 3 - How Much Insurance? Many financial experts advise...Ch. 3 - Automobile Costs Write a program that asks the...Ch. 3 - Celsius to Fahrenheit Write a program that...Ch. 3 - Currency Write a program that will convert U.S....Ch. 3 - Monthly Sales Tax A retail company must file a...Ch. 3 - Property Tax A county collects property taxes on...Ch. 3 - Senior Citizen Property Tax Madison County...Ch. 3 - Math Tutor Write a program that can be used as a...Ch. 3 - Interest Earned Assuming there are no deposits...Ch. 3 - Monthly Payments The monthly payment on a loan may...Ch. 3 - Pizza Pi Joes Pizza Palace needs a program to...Ch. 3 - How Many Pizzas? Modify the program you wrote in...Ch. 3 - Angle Calculator Write a program that asks the...Ch. 3 - Stock Transaction Program Last month Joe purchased...Ch. 3 - Planting Grapevines A vineyard owner is planting...Ch. 3 - Word Game Write a program that plays a word game...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY