Programming in C++ Assignment

profilejpFlute

Class Implementation and Vector Loops

Part A

Implement all member functions of the following class:

class Person

{

public:

    Person();

    Person(string pname, int page);

    string get_name() const;

    int get_age() const;

    void set_name(string pname);

    void set_age(int page);

private:

    string name;

    int age;  //0 if unknown

};

Part B

Write a loop that fills a vector V with ten random numbers between 1 and 100. 

Submit a screenshot of the executed program and the code of the program.

Part C

Write a loop that fills a vector V with ten different random numbers between 1 and 100.    

Submit a screenshot of the executed program and the code of the program.

    • 10 years ago
    • 20
    Answer(1)

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      programming_in_c.docx