So, Mr. Burns, the owner/operator of the (ONLY) nuclear reactor in town, has come under scrutiny of the EPA and has been notified that he must clean up his plant's cooling ponds. So, he rounds up some experts in environmental remediation and nuclear cleanup to take care of the matter. Lenny and Homer are going to take care of the problem. "It's those darned fish in the pond, stinkin' up the place", says Lenny....as Homer swallows several of the offenders. So, they toss the wildlife (fishies) out of the pond on to the banks, thus de-pollutifying the offending bodies of water. Stupid fish! Lisa, seeing this travesty, comes to the aid of the stranded fish....she's going to save them! But, she needs to have an easy way to calculate the tank volume and water capacity, tank dimensions, and number of aquiline occupiers (the fish) for an aquarium to hold the fish. You see, she's going to build tanks to save all those stinking fish. You are going to write a program in c++ that will assist her in this effort. The determining factor for the dimensions of any tank she builds will be the length of the tank. From this measurement, widt
Background: In the town of Springfield, RO (RO is a state abbr. for a nonexistent state), there is a group of community leaders known as the Simpsons. This semester, you will be solving problems for them, and in particular, Lisa Simpson. You know Lisa Simpson. She is quite often concerned with the welfare of the planet earth. This is all about an episode in the life of a young environmentalist and her ever-lasting fight to deal with a bunch of morons.
Due: Friday, Sept. 9, 2016 at noon 100 pts
For this assignment, you will submit a single C++ compilable file containing a program written in C++. Remember, to electronically submit a file to for this course, first change to the directory in which the file resides and then type in, at the UNIX prompt, the command:
cssubmit 1570 section_letter assignment_number
Be sure that only the file you want to submit is in that directory - make a directory for every assignment! Remember that the submit system will deliver every .cpp file in the current directory to me, so you should only have the file for hw 2 in that directory. Name your file a meaningful name and give it a .cpp extension since you will be compiling it. Also, make sure that you compile and run your program using the GNU (g++) compiler before submitting to make sure that it will work for the submit script.
h and height will be determined. And from the resulting volume, your program will compute the amount of water needed (not necessarily the same as tank volume!) and the number of fishies that will live there.
Specifications: Your program should first prompt the user to input the required length as a whole number (integer) of feet. (You see, uhhhh, the only glass cutter in town is Jasper, whose tape measure is so old that only the foot markings are visible.) It should then prompt the user for the presence of any fish with more than two eyes. Your program will then compute and output the
Dimensions of the tank
Volume of the tank
Volume of the water
Number of fish the tank will hold
Mass of nuclear waste to be added to the tank to keep the fish alive
Details:
The dimensions are determined thusly:
The length is input
The width is a quarter of the length, and height is 2/3 of the length. Now remember, the glass cutter can only deal with whole numbers, so both width and height must be rounded down to the nearest foot.
The volume of the tank in gallons is the width times length times height times the constant 7.48, the number of gallons of water in a single cubic foot. This value (and the next) should be a floating point number.
The volume of water needed is the tank volume minus the currently accepted standard number of gallons of food required for feeding freak fish. If present, they require 2 gallons of food to be dumped into the tank and so the volume of water needed to fill that tank must be 2 gallons less than the volume of the tank. Note: times change, and so could this number!
The number of fish the tank can hold is the volume of water divided by 25, the number of gallons necessary for each fish. Needless to say, this had better be a whole number - an integer!
These fish can no longer survive without exposure to nuclear radiation. So, Lisa will have to dump so much waste in the water to help the wildlife survive. Poor Lisa. The amount required is calculated to be the Liver Irradiation for Fish Existence factor (or LIFE factor...how ironic) divided by the height of the tank in inches. Note: the EPA dictates that LIFE be an integer, and currently it is set at 11.
Note on Simpsonian Physics: I'm sure that some of you would argue that, once the fish and toxic waste are dumped into the tanks, water will run out all over the floor. But your argument is full of holes, because the fish in Burns' cooling ponds are also (full of holes). Those fish, after years of exposure to radioactive waste, are all made of sponge (see picture to the right. Clearly, Spongebob, once a normal fish, is now a radioactive freak of nature displaying rather infantile intellect - the affect of being exposed to the Simpsons.) Rather than displacing water, they actually soak it up and the water level goes down! But we're not concerned with that, are we?
Have fun with your fishies........bye now
Your program should be "user friendly" in that it should have an opening statement or greeting, user friendly and understandable prompts, and clear and concise outputs and sign-off. Here's a good example of bad output:
5
Notice that there are NO prompts to speak of, and the output is completely unexplained. This is horrible output. Something like the following is much much better:
Welcome to the Fish Tank Computer
Enter the following info:
length of tank (in feet): 10
any freak fish (1 - yes, 0 - no) 1
Your tank dimensions are:
length 10 ft
width 2 ft
height 6 ft
tank cap 897.6 gals
water 895.6 gals
waste 0.1527 rads
Your tank will hold 35 fishies.
Note: Your program will prompt for the existence of special fish. We recommend you do this using a boolean variable. Prompt for a 1 or 0 (yes or no) and read into a boolean variable. You are not allowed to use conditional statements (if or if-else) in the program. Think carefully how to use the information you have input from the user, how it is stored, how boolean variables are represented. It is up to you how you want to name your variables and constants. Don't think that you should copy names that your employer/teacher/mentor (see picture above) use to describe a problem. YOU are writing the code. Use good programming practices.
When you submit: When you submit this, and all subsequent programs for this class, cssubmit will compile and run (assuming it compiles) your program during the submission process. Thus, when you submit, you will have to enter inputs as a user of the program. Now, in order to make the output uniform for the grader and to keep them sane, ALL OF YOU will enter the same information. For this assignment, it is:
length of 13 ft
affirmative to the presence of freaky fishies
As always, if you have any questions about this assignment, be sure to ask your (lecture) instructor.