Assignment 1
Assignment 1
Until now, we have implemented above mentioned concepts, only on a single class. It’s
about time that we shall learn how to operate multiple classes, on basis of the above
mentioned concepts.
When we consider a model, based upon multiple classes, there is a fair possibility that our
concerned class might have some sort of relationship with each other. In your next lecture
we’ll discuss, how we can identify different relationships amongst two or more classes and
then implement that relationship in our C++ code.
Before you come to your next class, you shall have a little know how about multiple classes’
manipulation. To serve that purpose, I am assigning you a pre lecture assignment. As always
we’ll persist with our usual case study, which is “student class object”. So far we have worked
upon following student class attributes:
Student attributes:
Name
Age
CGPA
Roll number
If you ponder a little and compare this instance with your common life, you will be able to
understand that “Name and Age” are not specifically a student’s attributes but a person’s.
Every person has a name and an age, but every person doesn’t have a CGPA or a roll number,
which specifically are student class’s objects.
As mentioned before, it’s about time that we shall learn how to differentiate amongst two
different classes, to begin let us differentiate our person class attributes from the above
mentioned student class.
Assignment 2
Object Oriented Programming Nabeel Sabir khan
This is where your assignment begins, you’ve all learnt how to manipulate a single class
from main function, this time you’ll have to perform the same task (i.e. maintain same
attributes as you did previously in your student class) but we will be making use of two
classes rather than one.
3
Following is the final state of this program:
DEADLINE: As you people have already implemented this case study for more than
a couple of times now, I assume after a little modification you’ll be able to code this
problem within no time.