Question
Program in c++ language PART A: (60%) ( Do not write programs for Part A) Design a program to solve the following problems. For each
Program in c++ language
PART A: (60%) (Do not write programs for Part A)
Design a program to solve the following problems. For each problem, you must create an IPO chart and a desk checking table. In the IPO chart, you must list the input items, the processing items and the output items in the IPO chart. You must use pseudocode to describe the steps in the algorithm. In the desk checking table, remember to create a column for each input, processing and output item. Use the two test cases provided in each question. What I am looking for in each problem is a complete IPO chart and a complete desk checking table, just like what you see in the attachment.
Please type and save your answers in a single Microsoft Word document.
A-1. Mary is a big fan of tropical fish. She has a few tanks of fish at home. To maintain a healthy environment for the fish, she needs to add conditioner to the water once a week. The amount of conditioner added is determined by the volume of the tank. According to the direction on the bottle, she has to add 1 ml of conditioner per 100 cubic inches of water. She wants a program to calculate exactly how much conditioner to add to a tank of water. All tanks are in rectangular shape. The program will ask for the length, the width and the height of the tank. It will calculate and display the amount of conditioner to be added. [Note: volume = length X width X height] Use the following two test cases for desk-checking [all in inches]: (20%)
length | width | height |
20 22.5 | 10 16 | 10 15 |
A-2. Recently Mary has bought a few more tanks of fish. Since the new tanks she bought this time are all in cylindrical shape, the program developed in Question 1 is inapplicable. She needs a new program that will ask for the radius and the height of the tank. It will calculate and display the amount of conditioner to be added. [Note: volume = radius X radius X 3.1416 X height] Use the following two test cases for desk-checking [all in inches]: (20%)
radius | height |
10 14.5 | 10 18 |
A-3. Jackets Unlimited is having a sale on its merchandise. The manager wants a program that requires the clerk to enter the original price of a jacket and the discount rate. The program should then display the new sales price. Use the following two test cases for desk-checking: (20%)
original price | discount rate |
100 50 | 0.25 (i.e. 25%) 0.10 (i.e. 10%) |
PART B: (40%)
Write a C++ program that implements the algorithm in part A-1 and then add code to write the result to an output file. Make sure you generate a description message with the data in the output file (i.e. The amount of conditioner to be added is 3 ml).
outFile << The amount of conditioner to be added is << amount<< ml< Name output data file conditioner.txt . radius height 10 14.5 10 18
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started