Write a cpp program to calculate the liquid level of a tank

Assignment Help C/C++ Programming
Reference no: EM131028315

INTRODUCTION TO PROGRAMMING

DESIGN PROJECT 1: C++ PROGRAM TO CALCULATE THE LIQUID LEVEL OF A TANK

Spring 2016 Problem Statement: A tank is shown in Figure 1. The tank had four inlet pipes (A, B, C, and D) each controlled by a valve and an outlet pipe (E).

614_Tank Diagram.png

Figure 1. Tank Diagram

The initial level of liquid in the tank at time zero or t(0) is 495 gallons. Inlet A has a flow rate of 5 gallons per second. The valve for inlet A is open for 10 seconds and then closes for 10 seconds and this cycle repeats as shown in Figure 2.

1391_Inlet A Flow Rate.png

Figure 2. Inlet A Flow Rate

Inlet B has a flow rate of 10 gallons per second. The valve for inlet B is open for 20 seconds and then closes for 20 seconds and this cycle repeats. Inlet C has a flow rate of 2.5 gallons per second. The valve for inlet C is open for 5 seconds and then closes for 5 seconds and this cycle repeats. Inlet D has a flow rate of 7.5 gallons per second. The valve for inlet D is open for 15 seconds and then closes for 15 seconds and this cycle repeats. Liquid continually flows out of outlet E at a rate of 20 gallons per second.

Develop a computer program using the engineering problem solving methodology to determine at which time the tank will be empty based upon the following conditions.

• If the valve for inlet A is open meaning liquid in flowing into the tank from inlet A, then the flow rate of inlet B is reduced by one half.
• The valve for inlet C can only be open if the valves for inlet A or B are closed.
• The valve for inlet D can only be open if two of the other three valves are open.

The results of the program should show in table format

A. Time steps (increments) of one second and the sum of the inlet flow rates (A+B+C+D) based on the above conditions
B. Time steps and the level of liquid in the tank. (Hints see page 142 of textbook_for an example of a C++ program to put values in a table and the tank will he empty before60 seconds or OM.
C. The program should also contain at least one if statement, one iflelse statement, one switch statement, and either a while loop or for loop.

Reference no: EM131028315

Questions Cloud

How many different combinations are there : A person has 3 different letters to write, 2 interviews to do, and 2 commercials to review. In making aschedule, (first, second, etc.) how many different combinations are there?
Create a script that presents a word guessing game : Create a script that presents a word guessing game. allow users to guess the word one letter at a time by entering a character in a form. start by assigning secret word to a variable.
Calculate the dc voltage that would be measured across r2 : Calculate the dc voltage that should exist across R2 without the Voltmeter present. Calculate the dc voltage that would be measured across R2 using a 10 kΩ/V analog voltmeter set to the 10-V range.
Briefly describe the supply chain management system : Briefly describe the supply chain management system. Review the product procurement process (product flow). Describe the activities used to coordinate key players in the product procurement process.
Write a cpp program to calculate the liquid level of a tank : C++ PROGRAM TO CALCULATE THE LIQUID LEVEL OF A TANK. Develop a computer program using engineering problem solving methodology to determine at which time tank will be empty based upon the following conditions.
Research paper outline based on the information below : One of the central concerns of the sociology of development is change. In societies of all times there is change affecting every realm of life social, economic, cultural, technological, demographic, ecological and so on.
Role of colonization : Study the development process of Jamaica by addressing the main themes covered in the textbook: role of colonization/path to independence/nation formation; early development policies; impact of neoliberalism and globalization on the economy and so..
Understanding of processes of global social change : The questions will focus on your understanding of processes of global social change. Your answers should be essays of 150 words each. 1. What are the global benefits of improving women's living conditions and status around the world?
Critics view literature through lens of modern psychology : "Critics view literature through the lens of modern psychology, exploring human behavior (conscious, subconscious and unconscious), literary language and symbolism

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a c program which takes a string from command line

Write a c program which takes a string from command line with mainfunction has no parameter and convert the string in upperca

  Design a calculator program that will add two numbers input

Design a calculator program that will add, subtract, multiply, or divide two numbers input by a user. Your program design should contain the following

  Compute the sum of the first

Assume there is a variable , h already associated with a positive integer value. Write the code necessary to compute the sum of the first h perfect squares, starting with 1 .

  Implement a point class for two-dimensional points

Implement a Point class for two-dimensional points (x, y). Include a default constructor, a copy constructor, a negate() function to transform the point into its negative, a norm() function to return the point's distance from the origin (0,0), an..

  Describe the class structure of c++ programming

Describe the class structure of C++ programming. What are the key contents of classes

  Write a c program that converts celsius temperatures to

write a c program that converts celsius temperatures to fahrenheit temperatures.the formula isf95c 32.f is fahrenheit

  Write a program to evaluate infix expressions

Write a program to evaluate infix expressions and summarize differences between array notation and pointer notation

  Develop a two dimensional interactive game

The player starts as a disk, but can "morph" (that is expand and contract) in selected directions

  Create a project and run the program

What is its equivalent in C++ code? Notice the similarity and differences between the codes provided below to C++ - create a project and run the program and see how it runs.

  Perpetual preferred stock

1) Johnson Corporation JUST PAID a dividend of $4.63.  The expected growth rate on dividends is 8 percent.  What is the current price of this stock if the required rate of return is 10 percent?

  Calculate and display the number of units of electricity

The manager of PG&E wants a program that calculates a customer's electric bill. He will enter the current and previous meter readings.

  Write and run a c++ program that computes and displays

A machine purchased for $28,000 is depreciated at a rate of $4,000 a year for 7 years. Write and run a C++ program that computes and displays a depreciation table for 7 years.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd