![]() |
| |||
| I'm not exactly sure what you are asking for (other than I am sure it's a homework assignment). If you mean you want to compute force, here's a simple JavaScript for that: <script type="text/javascript"> function computeForce(mass, accel) { //computes newtons of force from mass and accelleration inputs var newtons = 0; if(NaN(mass) || NaN(accel)) { alert('Bad parameters, try again.'); return false; } else { newtons = mass * accel; return newtons; } } var mass = 5; //mass in kg var accel = 9.8 //accelleration in m/s^2 var output = 'The force in Newtons of a ' + mass + 'kg mass at an accelleration of ' + accel + 'm/s^2 is ' + computeForce(mass, accel) + '.'; document.write(output); </script> |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How is Google PR Calculated ? I have the equation but I am no sure if it is right !!! | jeff | 3 | 01-04-2008 11:32 PM | |
| Hiphop=sex+drugs+money+hoes...(wrong equation..!)? | chatchai | General Discussions | 5 | 07-06-2006 08:36 PM |