Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 6 (a) What is the difference between a class and an object in object oriented pro gramming? [3 marks] (b) Objects model state and

image text in transcribed

Question 6 (a) What is the difference between a class and an object in object oriented pro gramming? [3 marks] (b) Objects model state and exhibit behaviour. Explain how state and behaviour are implemented in C+ + [2 marks] (c) What is the role of a class destructor? How is it written in C++? Give an example of what you might do in a destructor. (d) When is it necessary to define a default constructor? (e) What is the purpose of static class variables? (f) Briefly describe the use of encapsulation and abstraction in C++ classes? [3 marks] [2 marks] [2 marks] [3 marks] (g) Complete the following table on C++ class access control, using Y if the ac- cess is allowed and 'N' if it is not.The public access control has been done for you (public variables and methods are available within the class, within subclasses and also outside of the class, within class within subclass outside of class public private protected [3 marks]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Were the decisions based on appropriate facts?

Answered: 1 week ago

Question

Were the right people involved in the decision-making process?

Answered: 1 week ago