Last active
October 29, 2017 22:07
-
-
Save Streta/45d34e3a224b7f547f492038fc191cc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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