Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The C++ Tropical Fish store is here to help you select the perfect tank for your tropical fish enjoyment. The first rule of thumb for

The C++ Tropical Fish store is here to help you select the perfect tank for your tropical fish enjoyment. The first rule of thumb for setting up a nice, healthy fish tank is two gallons of water for every inch of fish in the tank. You must remember to consider the adult size of the fish. This means if you have three adult fish, and each fish is 3 long, you need to have at least an 18 gallon tank. The second rule involves what sort of fish will live in the tank. If all of the fish are peaceful, then a tank sized according to total adult fish length will be fine however, if there are aggressive fish in the tank, then the tank should be sized 1.5 times that. That is only an approximation, and in real life, you would have to carefully select your fish to make sure they get along well. But for this program, we will follow the two rules we just listed. Start your program in main by writing out your course header. Declare 3 vectors, one for the type of fish (i.e. tetra, loaches, etc), one for the number of each type of fish, and one that holds the adult size of a single fish. This means that the same element in the three vectors correspond to one type, size and number of fish. For instance, an adult tetra would grow to be 1inch in length, and there might be 4 of them in your tank. Then open a do while loop for setting up one fish tank. This is also called a play loop. You may need to declare some variables here. We will ask the user to enter the information for the fish they expect to place in the new tank, then we will suggest the correct size tank. Tanks come in 4 sizes in our store: 20, 40, 60 and 80 gallons. Set up 3 vectors, one for the type of fish (i.e. Tetra, Loaches, etc), one for the number of that type of fish, and one that holds the adult size of a single fish. This means that the same element (or index) in the three vectors correspond to one type, size and number of fish. For instance, an adult tetra would grow to be 1inch in length, and there might be 4 of them in your tank. Open a while loop to collect the fish data. Ask the user to enter all of this information. When the user enters done for the fish type, the loop will exit and stop collecting data. Next ask your user if there are any aggressive fish in the group. Determine that best size tank based on the two rules. If the user would need a tank bigger than 80 gallons, tell the user that we dont carry any bigger tanks. Write out a tank report, including a table showing the fish information, total fish, total length of fish, minimum required gallons and the appropriate C++ tank. Here is a sample for 4 Clown Loaches and 5 Neon Tetras: C++ Tropical Fish Store Tank Requirements Type of Fish Number Adult Size Clown Loach 4 3 Neon Tetra 5 1 Aggressive: No Total Fish Length: 17" Min Tank Size: 40 gallons Then ask the customer if he/she wants to calculate another fish tank. If the answer is yes, loop back to the top of the while loop. If the answer is no, drop out of the loop, and show your customer a good-bye message.

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

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions