// Haroon Achackzad CS1A Chapter 4, P. 220, #6
//
/**************************************************************
*
* Mass and Weight
* ____________________________________________________________
* This program asks a user to enter a mass in between 10-1000 Newtons
* and to calculate the weight of that object through user input within
* range.
*
* Computation is based on the formula:
* Weight= Mass* 9.8
* ____________________________________________________________
* INPUT
* mass= Force of Gravity on an object
*
* OUTPUT
* weight: product of mass *9.8
*
**************************************************************/
#include
using namespace std;
int main() {
//variables
float weight,
mass;
// Make user enter the Object's mass
cout << endl;
cout << "What is the object's mass: ";
cin >> mass;
// Calculation for Weight
weight = mass * 9.8;
//Show weight on display
cout << "\nObject's weight = ";
cout << weight << endl << endl;
if (weight >= 1000)
cout << "too heavy. ";
else if (weight <= 10)
cout << "too light. ";
else
cout << "Neither Heavy or too light. ";
cout << endl << endl;
return 0;
}