COS1512 ASSIGNMENT 2 SEMESTER 2 2022. 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 corres...
, COS1512 Assignment 2 Semester 2
UNIQUE NUMBER
DUE DATE:
TUTORIAL MATTER: Chapters 10, 11, 12 and 15 of the Study
Guide (Tutorial Letter 102 available under
Additional Resources on the COS1512
website on myUnisa )
Chapters 10, 11, 12 (excluding “Creating a
Namespace”) and 15 (only 15.1 “Inheritance
basics”) in Savitch
Appendices 7 and 8 in Savitch
WEIGHT: 80%
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 classMeeting (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.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying this summary from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller STUDYLAB2023. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy this summary for R53,80. You're not tied to anything after your purchase.