Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 :-