Question: C++ #include #include using namespace std; class Person { private: string name,eye_color; int age, weight; bool likes_cuny; public: Person(); // CTOR void Display(); // Precondition
C++
#include
class Person { private: string name,eye_color; int age, weight; bool likes_cuny;
public: Person(); // CTOR void Display(); // Precondition : name is assigned through constructor // Postcondition : Will print Person's name int getX(); int getY(); void setX(int); void setY(int);
};
int main() {
Person A, B, C;
A.Display();
return 0; }
Person::Person() { name="Bob"; } // Remember that the above function is a constructor, and doesn't use a return type void Person::Display(){cout << name;}
Questions. ( I need in succinct code) C++
1.Prompt user How many people are we initializing?
2.For that amount, using a for loop, make and define that many people with at least 2 member variables of your choice.
3.After each defined person, output some of their data using a member function of the Person class
4.Using a member variables of your choice, create an array consisting of any of those values and sort them from greatest to least.
5.If 2 variables are the same, let the user know.
Hint (When testing your program, you can use constructor functions to set some values automatically, without prompting user.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
