Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming Original Work only please We will write a program that simulates a fishing game. Ask the user will be asked if they want

C++ Programming Original Work only please

We will write a program that simulates a fishing game. Ask the user will be asked if they want to fish. If so, a six sided die will be rolled. The number will determine what type of fish is caught. Each fish will have a specific point value. The points will be totaled as long as the player wants to keep fishing. When they wish to quit, the program should display their all the items that were caught as well as the total point value. Here is an example run:

image text in transcribed

Some things your program should have:

A Fish Class that should have member variables for the fish type and the point value of that fish. A member method that sets the variables and one each that gets the type of fish and the point value.

The dice class example on page 788 can be used to generate a number

An Array to hold the items caught. This should be of the Fish Class data type.

The fish types should be in an array in the main program. So should the point values.

Your program should loop, asking the playing if they want to keep fishing. If they do, you roll the die and use that to figure out what they caught.

The program should only display what the player caught and not the point value.

When the player wants to stop fishing, call a method that displays all the items the player caught along with the point value. Then it should report the total score.

Do you want to play the fishing game (y or n)? y You feel a tug.... You caught a toilet seat! Do you want to keep fishing (y or n)? y You feel a tug.... You caught a grass carp! Do you want to keep fishing (y or n)? y You feel a tug.... You caught a 5 pound bass! Do you want to keep fishing (y or n)? n You caught: Item 1: a toilet seat for 1 points! Item 2: a grass carp for 4 points! Item 3: a 5 pound bass for 10 points! Your total score is 15 points Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions