Skip to content

Instantly share code, notes, and snippets.

@Streta
Last active October 29, 2017 22:07
Show Gist options
  • Save Streta/45d34e3a224b7f547f492038fc191cc5 to your computer and use it in GitHub Desktop.
Save Streta/45d34e3a224b7f547f492038fc191cc5 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main()
{
int mass = 1;
float weight;
while (true)
{
cout << "Enter your objects mass (in kg). A Neg num stops program";
cin >> mass;
weight = mass * 9.8;
if (mass <= 0)
{
return 0;
}
else
{
if (weight >= 1000)
{
cout << "Your object is too heavy!\n";
}
else (weight < 10)
{
cout << "Your object is too light!\n";
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment