Formula= weight=mass*9.8 C++ // Get the object\'s mass. cout << \"Enter the obje
ID: 3586892 • Letter: F
Question
Formula= weight=mass*9.8 C++// Get the object's mass. cout << "Enter the object's mass (in kilograms): "; //enter code here
// Calculate the object's weight in Newtons. //enter code here
// Display the object's weight. cout << "The object weighs " << weight << " Newtons. ";
// Determine whether the object is too heavy // or too light.
//enter code for if or if..else or if..else if cout << "The object is too heavy! ";
cout << "The object is too light! ";
return 0; } cout << "The object is too heavy! ";
cout << "The object is too light! ";
return 0; } Save TiTe as mainNeW before submitting Enter the object's mass
Explanation / Answer
main.cpp
#include <iostream>
using namespace std;
int main()
{
float m,w;
cout << "Enter the object's mass (in kilograms): ";
cin>>m;
w=9.8*m;
cout << endl<<"The object weighs " << w<< " Newtons. ";
if(w>490){
cout << endl<<"The object is too heavy! ";}
else if(w<490){
cout << endl<<"The object is too light! "; }
else{}
return 0;
}
Output :-
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.