We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search


+ Link For Assignments, GDBs & Online Quizzes Solution


+ Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Pre-Assignment Task


Problem Statement:

Write a program in which

1)      Create a class named Keyboard having data members’ model, albKeys, numKeys, and funcKeys.

2)      Class has a default constructor in which members are initialized through macros like  MODEL “HP”


After creating the object using default constructor, the message “Keyboard Created” should be displayed.

3)      Also create a destructor for the same class which shows message “Keyboard has been destroyed” as soon as it is called.

4)      Overload the Assignment Operator for this class which accepts an object pointer of the Keyboard class.

5)      The Overloaded Assignment Operator will assign the values of all the data members of passed object to the data members of the calling object. A message “Keyboard is assigned” will be displayed as soon as the Overloaded Assignment Operator is called.

6)      In main() function, an object pointer of the class Keyboard will be created using the new operator.

7)      Another object of class Keyboard will be created simply.

8)      Assign the first object to the second object using Overloaded Assignment Operator.



Sample Output:

Keyboard created.

model = HP

albKeys = 26

\numKeys = 10

funcKeys = 12



Keyboard created.

model = HP

albKeys = 26

numKeys = 10

funcKeys = 12


Keyboard is assigned.

Keyboard has been destroyed.

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

See Your Saved Posts Timeline

Views: 798


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

Which lecture we should prepare for this pre-assessment program, coz i was busy in past days and i've missed about 10 lectures of CS201. 

lec 23 is on macros

then you need to check lec 27 onwards relating to classes constructors and destructors

Kindly share the solution idea..

Please upload the solution


Today Top Members 

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service