Answer to Question #228303 in C++ for Onai Maxwell

Question #228303
a. C++ is known to be an object-oriented program. Objects are also known
to exist in real life. You have been invited as a computer science student
to distinguish between real life objects and object found in object oriented
program OOP.

b. Write an OOP to compare the risk factor that will lead to high payment of
life insurance premium. The variables to consider are: age, weight, and
height
1. The program should request for the variables to be inputted from the
keyboard.

2. Premium should be high if age is greater than or equal to 60 years and
weight is greater than or equal 80kg and has greater than or equal 6.8 feet. Otherwise the premium should be low.

3. Critically explain how the program could be adopted by allied companies for their operations.
1
Expert's answer
2021-08-23T01:18:19-0400
// a. Real life object is something that can be grabbed and has properties while object found in object oriented


// program OOP are instances of a class.


// b. 
#include <iostream>


using namespace std;


int main()
{
    int age;
    double height,weight;
    cout<<"\nEnter age: ";
    cin>>age;
    cout<<"\nEnter weight: ";
    cin>>weight;
    cout<<"\nEnter height: ";
    cin>>height;
    if (age>=60 && weight>=80 && height>=6.8)
        cout<<"\nPremium is high";
    else
        cout<<"\nPremium is low";


    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

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS