//Andres Guzman CSC5 Chapter 4, P. 220, #6
//
/**************************************************************
*
* CALCULATE THE WEIGHT
* ____________________________________________________________
* This program will calculate the weight of an object.
*
* Computation is based on the formula:
* Weight = mass x 9.8
* ____________________________________________________________
* INPUT
* mass = The mass of the object
* OUTPUT
* weight = the total newtons of the object
*
**************************************************************/
#include <iostream>
using namespace std;
int main()
{
float mass; //Input for the mass of an object
float weight; //Input for the calculation for the weight of an object
//
//
cout << "Object's Mass: ";
cin >> mass;
//
//
weight = mass * 9.8; //Calcuation for the objects weight
//
//
cout << "\nObject Weight: " << weight << endl;
if (weight > 1000)
cout << "The object is too heavy";
if (weight < 10)
cout << "The object is too light";
}
Ly9BbmRyZXMgR3V6bWFuIENTQzUgQ2hhcHRlciA0LCBQLiAyMjAsICM2Ci8vCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgoqCiogQ0FMQ1VMQVRFIFRIRSBXRUlHSFQKKiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KKiBUaGlzIHByb2dyYW0gd2lsbCBjYWxjdWxhdGUgdGhlIHdlaWdodCBvZiBhbiBvYmplY3QuCioKKiBDb21wdXRhdGlvbiBpcyBiYXNlZCBvbiB0aGUgZm9ybXVsYToKKiBXZWlnaHQgPSBtYXNzIHggOS44CiogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCiogSU5QVVQKKiBtYXNzID0gVGhlIG1hc3Mgb2YgdGhlIG9iamVjdAoqIE9VVFBVVAoqIHdlaWdodCA9IHRoZSB0b3RhbCBuZXd0b25zIG9mIHRoZSBvYmplY3QKKgoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KI2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkO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