100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

COS 1512 ASSIGNMENT 2

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
09-09-2021
Written in
2021/2022

Question 1 Consider the following structure used to keep record of a meeting: struct Meeting { string speaker; string topic; string venue; string date; } Turn the meeting struct into a class. The class should have member variables for all the values in the corresponding struct. Make all member variables private. Include public member functions for each of the following:  a default constructor that sets the string data members to blank strings;  member functions to set each of the member variables to a value given as an argument to the function (i.e. mutators);  member functions to retrieve the data from each of the member variables (i.e. accessors); Test the class in a program that instantiates an object of class Meeting (i.e. ‘declare’ an object of ‘type’ Meeting). The program should then input values for the object (obtained from the keyboard), and use the mutators to assign values to the member variables. Use the accessors to obtain the values of the member variables of the object and display those values on the screen. Test your program with appropriate input. This study source was downloaded by from CourseH on :38:34 GMT -05:00 This study resource was shared via CourseH Question 2 – a bit of theory and terminology (a) What is the purpose of the keywords public and private in the class declaration? (b) What is the difference between a class and an object? (c) What does it mean to ‘instantiate’ an object? (d) What is the purpose of a constructor? (e) What is the difference between the default constructor and the overloaded constructor? (f) What is the purpose of a destructor? (g) What is the purpose of an accessor? (h) What is the purpose of a mutator? (i) What is the purpose of the scope resolution operator? (j) What is the difference between the scope resolution operator and the dot operator? (k) What is the difference between a member function and an ordinary function? (l) What is an abstract data type (ADT)? (m) How do we crea

Show more Read less









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
September 9, 2021
Number of pages
8
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
AcademicFountain Johns Hopkins University School Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
44
Member since
4 year
Number of followers
30
Documents
359
Last sold
3 months ago

3.5

4 reviews

5
1
4
0
3
3
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions