Answer to Question #288736 in C++ for David Beckham

Question #288736

Suppose that you are working with XYZ company and received a new task by your supervisor.

Your task is to write a C++ program to identify person who have height more than 180cm and

weight less than 50kg based on 5 different persons inputs. Prepare an algorithm for this problem

and write a complete C++ program. You must state a meaningful comment for each of your line. 


1
Expert's answer
2022-01-20T01:46:06-0500
#include <iostream>


int main()
{
    float weight = 0;
    int height = 0;
    for(int i = 0; i != 5; ++i)
    {
        std::cout<<"__XYZ__"<<std::endl;
        std::cout<<"Please enter your weight: ";
        std::cin>>weight;
        std::cout<<"Please enter your height: ";
        std::cin>>height;
        if(weight < 50 && height < 180)
        {
            std::cout<<"You are detected"<<std::endl;
        }
    }

    
    
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment