
Sunday, April 26, 2009=]
Waa.. Its 5 am now..Cannot fall aslp due to some reason.. (maybe homework not done??)Anyway just wan to share how programming is such a waste of time../* Name : Bicong Class : P1T3
This programs calculates the gravitational energy of an object given its mass and height from the ground.
*/
#include
#define G 9.81 // define a symbolic constant
void main (void)
{
/* declaration */
float mass, height, pEnergy;
/* initialisation */
printf (" Enter the mass of the object : ");
scanf ("%f", &mass);
printf (" Enter the height of the object : ");
scanf ("%f", &height);
/* calculate the potential energy */
pEnergy = mass * G * height;
/* output*/
printf("\t Mass is %f kg and its height from the ground is %f m\n\n",
mass, height);
printf("potential energy is %f J\n", pEnergy);
}// end mainThis is what i have to type to get a simple calculation done like potential energy which is simply mass x gravity x height..See what i mean by waste of time??I can do this calculation in 5 sec wif my calculation??I have to spend like 10 mins typing n checking for a missing dot..Wif technology comes great convenient..Wif programming comes great waste of time..
GOOD KID
Name: BiCong
D.O.B: 30/09/91
Libra