Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi I need this lab done in a simple way c++ Background: The local pet store has 35 different bowls with fish in them arranged

Hi I need this lab done in a simple way c++

Background: The local pet store has 35 different bowls with fish in them arranged in a circle in the fish room. The first six have goldfish, the next seven have guppies, the next nine have angel fish, the next eight have goldfish, and the last five hold tiger fish. As the bowls vary in size, the number of fish that are in each bowl at the start of the day also varies. The count of fish in each bowl is as follows: Bowls 1 3: 15 fish Bowls 4 7: 8 fish Bowl 8: 19 fish Bowls 9 12: 16 fish Bowls 13 22: 14 fish Bowls 23 24: 31 fish Bowls 25 29: 9 fish Bowls 30 33: 26 fish Bowls 34 35: 8 fish HoustonWe have a Problem: A trained seal finds its way into the store. The seal begins to eat fish in the following manner. a. It walks over to bowl #1. b. It counts four bowls and then eats a fish (the first fish it eats comes from bowl #4 and its a goldfish). c. It again counts four, starting with the next available bowl, and eats a fish (the second fish it eats comes from bowl #8 and its a guppy. Method: The conditions that controls the seal are: a. If there are no fish left in a bowl, the seal does not count the bowl and skips it and goes to the next bowl containing fish. (It starts counting four from the bowl it ate from.) b. The bowls are arranged in a circle, there is no last bowl. c. After the seal eats a bowl #35, it counts over 4 bowls and finds itself at bowl #4. (Bowl #3 if four bowls away from 34, etc.) d. The seal continues to eat until 361 fish are consumed. Your Task: You are to write a C++ program that will calculate and report the following (put breaks in so the user can read): a. The number and type of fish in each bowl before the seal begins eating. b. The total number of each type of fish before the seal begins to eat. c. The number and type of fish left in each bowl after each time the seal eats. d. The total number of each type of fish remaining after the seal eats.

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_2

Step: 3

blur-text-image_3

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions