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

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

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

 

Assignment No. 5
Semester: Fall 2010

CS201: Introduction to Programming 

Total Marks: 20

 

Due Date: Jan 31st  ,2011

 

Instructions:

Please read the following instructions carefully before submitting your assignment:

It should be clear that your assignment will not get any credit if:

 

§         The assignment is submitted after due date.

§         The submitted assignment does not open or file is corrupt.

 

All types of plagiarism are strictly prohibited.

 

Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted. If you will submit code any other file format like .doc or .txt etc. you will get zero marks.

 

Objective

The objective of this assignment is to provide hands on experience of using

 

§         User defined manipulators

§         Static member

§         Copy Constructor

 

Guidelines

§         Code should be properly aligned and well commented.

§         Follow C/C++ rules while writing variables names, function names etc.

§         Use only Dev-C++ IDE for this assignment.

 

Assignment

 

 

Problem Statement:

 

  • You are required to write a program of class rectangle named CRectangle which should draw two rectangles by using iTop, iRight, iBot, and iLeft. Then program should calculate the area of both. Number of rectangles should be displayed to user by using static variable counter which would keep track of increment or decrement of rectangles. Dynamically Create another rectangle by using copy constructor and increment in counter should be displayed on screen. Decrement in static variable counter (after de-allocating memory which was dynamically allocated) should be displayed again on screen.

 

Sample Output

Area of rectangle 1 is 6400

Area of rectangle 2 is  5600

The number of rectangles is 2          

After using copy constructor, total number of rectangles is 3

The number of rectangles is 2

 

 

Detailed Description:

 

1.  The class should have 4 members: iTop, iRight, iBot, and iLeft, all of type int.

2.  Area of both rectangles should be calculated by using iTop, iRight, iBot, and iLeft.

3.  It should have a default constructor and a copy constructor.

4.  It should have a destructor.

5.  It should contain all required getters and setters.

6.  It should contain a static member, iRefCount, which keeps track of the number of CRectangle objects. Increment it in the constructor, and decrement it in the destructor.

 

 

Hint:

CRectangle would implement rectangles by using left, right, top and bottom and calculate their areas to compare.

 

 

GOOD LUCK

 

Deadline:

Your Assignment solution must be submitted on or before Jan 31st, 2011.





 

+ 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: 496

.

+ 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)

Attachments:

Replies to This Discussion

u r full time ghda

neeche daikho bro ne bna di hai.... :)

me nai bna'i hoti to definitely share krti samje

 

abi muje choro n khuram bhai k peeche pro u :P

plz anyone upload the cs201 assignment # 5 solution

today is  the last date

See the attached file pleas e
Attachments:
khuram bhai last ki 6th line mai error hai

No one of all uploaded solutions is appropriate to the problem given

so

my dear preshan diloooooo tention ko khooob khooob enjoy kro degreee lenay k baad esi tention kabhe naheeen milay ge so is qeeemty time ko yahaan barbad kr k khooob mazay loootoooo 

g bilkul kiooon ka degree lainay ka bad software house khol kar hum na kon sa coding karni ha hana. is lye noooooo tensn

 

dekha Tariq bhai kis tarha mazaq urra rhay hain dosray sol upload kr kr k hahahahaha :P :D
Sir please help us and upload the solution, i am just not understanding the iRefcount function, or just tell us wither grace period is available or not
plz help in this solution upload rite code GOD bless u ........thxxxxx
Time Over...........ab koi faida nahi upload krany ka ....................!!!!

RSS

Latest Activity

+ M.Tariq Malik replied to + M.Tariq Malik's discussion CS508 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 12-11-2019 in the group CS508 Modern Programming Languages
26 seconds ago
+ !! SARAH replied to Rana Ali's discussion Tell some words in the Shan of Hazart Muhammad (S.A.W)
2 minutes ago
Hiba Sani joined + M.Tariq Malik's group
4 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion MTH301 Calculus II GDB Fall 2019 Solution & Discussion
4 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MTH301 Calculus II GDB Fall 2019 Solution & Discussion in the group MTH301 Calculus II
5 minutes ago
+ M.Tariq Malik added a discussion to the group MTH301 Calculus II
6 minutes ago
Preçîõûš replied to + M.Tariq Malik's discussion MGT101 Assignment No 01 Fall 2019 Solution & Discussion Due Date: 13-11-2019 in the group MGT101 Financial Accounting
8 minutes ago
Hiba Sani replied to + M.Tariq Malik's discussion CS401 Assignment No 01 Fall 2019 Solution & Discussion in the group CS401 Computer Architecture and Assembly Language Programming
8 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion BIO201 Basic Cell Biology Assignment No 01 Fall 2019 Solution & Discussion in the group BIO201 Basic Cell Biology
10 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion BIO201 Basic Cell Biology Assignment No 01 Fall 2019 Solution & Discussion
11 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion BIO202 Biochemistry-I Assignment No 01 Fall 2019 Solution & Discussion in the group BIO202 Biochemistry-I
11 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion BIO202 Biochemistry-I Assignment No 01 Fall 2019 Solution & Discussion
11 minutes ago
+ M.Tariq Malik added a discussion to the group BIO201 Basic Cell Biology
11 minutes ago
Hiba Sani joined + M.Tariq Malik's group
11 minutes ago
+ M.Tariq Malik added a discussion to the group BIO202 Biochemistry-I
11 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion MCM431 Development Communication Assignment No 01 Fall 2019 Solution & Discussion in the group MCM431 Development Communication
14 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion MCM431 Development Communication Assignment No 01 Fall 2019 Solution & Discussion
14 minutes ago
+ M.Tariq Malik added a discussion to the group MCM431 Development Communication
14 minutes ago
+ M.Tariq Malik replied to + M.Tariq Malik's discussion PSY511 Environmental Psychology Assignment No 01 Fall 2019 Solution & Discussion in the group PSY511 Environmental Psychology
19 minutes ago
+ M.Tariq Malik liked + M.Tariq Malik's discussion PSY511 Environmental Psychology Assignment No 01 Fall 2019 Solution & Discussion
19 minutes ago

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

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