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

  Take four unsigned char bytes and combine

Take four unsigned char bytes and combine them into a single integer type. You will needed shifts and one of the logical bit operators.

  Digital filtering

Write a main code that reads filter coefficient data from the file filter.txt and creates a filter, reads an input float_seq from the file input.txt, filters the input float_seq using the filterand then writes the output float_seq to the file, output..

  Find the occupation and the score of each player

We saw in class how to represent a binary search tree in Prolog. Write a predicate lca (K1, K2, T) which allows one to find the smallest common ancestor of K1 and K2 in the tree T. The predicate lca shall print the subtree T such that the root is ..

  Compute the squares of the numbers in the array

Write a java program to find the number in the given list. Write a java program to find the location of an element in the list.

  Statements that return container data only return container

Make sure all return statements that return container data only return container data.  If a return statement returns container data under certain conditions, but another return statement returns something that is not container data under other condi..

  Create a bitoutputstream

Implement a class named BitOutputStream, as shown in Figure for writing bits to an output stream. The writeBit(charbit) method stores the bit in a byte variable. When you create a BitOutputStream, the byte is empty

  Write a program that gives a prompt to the users

Write a program that gives a prompt to the users, asking for an integer n. It then prints out a random permutation, on one line , of 1,2,.......n separated by spaces or lines.

  Use selection sort to sort a[48] into increasing order

Use selection sort to sort A[48] into increasing order, and then print out the sorted list in four rows. There may be duplicates, but that's OK. (65 and 53 appear twice.) Duplicates will appear next to each other in the sorted list.

  Program to print out invalid number to character

The integer must contain 3 distinct non-zero number, or the program will print out invalid number.it should print out invalid query.

  Calculate the surface area and volume of the sphere

Calculate the surface area and volume of the sphere. Finally  the surface area and the sphere should be printed onto the screen. The printing statements

  Use the convention that all years have 360 days

In writing the days() function, use the convention that all years have 360 days and each month consists of 30 days. The function should return the number of days for any Date structure passed to it. Write a main () function to test your function.

  Write a c program for a hcs12 micro controller that writes

Write a C program for a HCS12 microcontroller that writes the value, 0x78, to Memory Location VAR1 and then calls a delay function. The delay function should generate a delay of 0.25 milliseconds

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