Contents
clc
clear all
IDENTIFICATION
Name: Autar Kaw (Put your name here) Section : 001 (Put Section here) Semester: Fall 2011 Due Date & Time: August 29, 2011 (Put due data and time here)
disp('Name: Autar Kaw (Put your name here)') disp('Section : 001 (Put Section here)') disp('Semester: Fall 2011') disp('Due Date & Time: August 29, 2011 (Put due data and time here)')
Name: Autar Kaw (Put your name here) Section : 001 (Put Section here) Semester: Fall 2011 Due Date & Time: August 29, 2011 (Put due data and time here)
BACKGROUND and DESCRIPTION
Title: The kinetic energy of a moving body is given by KE=(1/2)*m*v^2; where, m = Mass of the Body, kg v = Velocity of the body, m/s
disp('This program finds the Kinetic Energy of the body')
This program finds the Kinetic Energy of the body
INPUTS
disp('Find the KE of an object') disp('INPUTS') m=30; v=107; % See the use of '' to be able to use an apostrophe fprintf(' The object''s mass is %g kg\n',m) fprintf(' The object is moving at %g m/s\n\n',v)
Find the KE of an object INPUTS The object's mass is 30 kg The object is moving at 107 m/s
CODE
KE=(1/2)*m*(v^2);
OUTPUTS
disp('OUTPUTS') fprintf(' The object has a kinetic energy of %g J\n',KE)
OUTPUTS The object has a kinetic energy of 171735 J