Concept explainers
You have been assigned to a new project at work. The previous engineer had created the following files, which your new boss claims do not work. Debug the program to correct all errors.
These files must be corrected to eliminate any syntax, runtime, formula coding, and formula derivation errors. You may assume that the header comments at the top of the program and all comments throughout the program are correct.
% Problem Statement: A cylindrical tank filled to
% a height of 25 feet with tribromoethylene has been
% pressurized to 3 atmospheres (P_s = 3 atm).
% The total pressure (P_t) at the bottom of the tank is
% 5 atmospheres.
% This program will determine the density of the
% tribromoethylene in units of kilograms per cubic meter.
% Inputs :
% Height H 25 ft
% Surface Pressure P_s 3 atm
% Total Pressure P_t 5 atm
% Outputs:
% Density rho ? kg/m^3
% Assumptions:
% Gravity g 9.8 m/s^2
% Define input variables
25 ft H;
3 atm P_s;
5 atm P_t;
9.8 m/s^2 = g;
% Convert total and surface pressure from atm to Pa
Psurf = P*1,211,458;
P_t = P_t*14.7;
% Convert height from ft to m
H*3.28;
% Calculate density, knowing the calculation of total
% pressure using equation P_t P_s + (rho) (g) (H)
P_t = P_s + (rho) (g) (H)
Want to see the full answer?
Check out a sample textbook solutionChapter 17 Solutions
Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY