Answered step by step
Verified Expert Solution
Question
1 Approved Answer
not really sure how to finish this code. please help and zoom in if needed, thank you! Scientists measure an object's mass in kilograms and
not really sure how to finish this code.
please help and zoom in if needed, thank you!
Scientists measure an object's mass in kilograms and its weight in newtons. If you know the amount of mass that an object has, you can calculate its weight in newtons, with the following formula: weight = mass * 9.8 Write a program that reads in an object's mass, and then calculates and displays its weight in the specified format. If the object weighs more than 1,000 newtons, display the message "It is too heavy." If the weight is greater than 10 and less than or equal to 1000, display the message "It is a good weight." If the weight is greater than 0 and less than or equal to 10, display the message "It is too light otherwise that is the weight is zero or negative), display the message "Invalid weight. You should enter a mass greater than 0." Your program should use an if-else-if construct. Hint. The program will be easy to code if you check the greater-than-1000 condition first, then the greater-than-10 condition, then greater- than-0 condition. Think about the implied condition at each step. So your code may look like: if (weight > 1000) else if (weight > 10) I/implied condition: weight 0) I/implied condition: weight 6 #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started