You have been assigned to a new project at work. The previous engineer had created the following file, which your new boss claims does 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 Slaloming: A ball.is thrown vertically :into
% the air with an initial kinetic energy of 2,500 joules.
% As the ball rises, it gradually loses kinetic energy
% as its potential energy increases. At the top of
% its flight, when its vertical speed goes to zero, all of
% the kinetic energy has been converted into potential energy.
% Assume that no energy is lost to frictional drag, etc.
% How high does the ball rise in units of meters if it has
% a mass of 5 kilograms?
% Input Variables
% KE - Kinetic Energy [J]
% m - Mass of ball [kg]
% Output Variables
% H - Max height of ball [m]
% Other Variables
% g - Acceleration due to gravity {m/s^2]
% Assumptions
% No energy losses due to friction
% g = 9.8 m/s^2
clearscreen
clearworkspace
% Set initial variables
2500 = KE;
m = 5 kg;
gravity = 9.8;
% Calculate height, assuming
% Kinetic Energy = height * mass * -gravity
KE(2500) = H * m * g
Want to see the full answer?
Check out a sample textbook solutionChapter 17 Solutions
Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
Additional Engineering Textbook Solutions
Manufacturing Engineering & Technology
Mechanics of Materials, 7th Edition
Thermodynamics: An Engineering Approach
EBK FUNDAMENTALS OF THERMODYNAMICS, ENH
Statics and Mechanics of Materials
Mechanics of Materials (10th 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