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


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.

 

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: 544

.

+ 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

Please Discuss here about this assignment.Thanks

plz upload the solution of CS201 assignment#5 plzz

Tariq bahi plz help us in the this assignment. we are waiting for your help. plzzzzzzzzzzzzzzzzzz

this assignment is vague.

how to calculate rectangle area?

how to give values to int iright itop etc? and with what sequence? i mean which shud be lower which should be higher?

how to compare the both ?

it needs more elaboration

plzz upload solutions thxxxxx

The program should display like;

Please Enter Grade (‘A’ OR ‘B’ )
Then the program should take 10 inputs one by one,


•After taking 10 inputs, you should display no. of A grades.
•If A grades are less than or equal to 2, you should display a message “Your class is Poor!”. 
•If A grades are less than or equal to 7, you should display a message “Your class is Good!”.
•If A grades are greater than or equal to 8, you should display a message “Your class is Brilliant!”.
•The user should enter either A or B. If user has entered other than A or B, e.g. C,D,E etc. Your program should display a message like; 
"Please Enter 'A' or 'B' grade only!"

Sample Input and Output 
Please Enter Grade of student 1 : 
A Please Enter Grade of student 2 : 
A Please Enter Grade of student 3 : 
B Please Enter Grade of student 4 : 
A Please Enter Grade of student 5 : 
B Please Enter Grade of student 6 : 
B Please Enter Grade of student 7 : 
A Please Enter Grade of student 8 : 
B Please Enter Grade of student 9 : 
C

Please Enter ‘A’ or ‘B’ grade only! Please Enter Grade of student 9 : 
A
Please Enter Grade of student 10 :

A

Total No. of A Grades = 6



Arey Maani bhai ye kya upload kr dia ??? ye to koi purane wali he. plz chk it out..
dear ye tu purani assignment hai.
Today is the last date i think this time we can't submit our assignment....
be pztv dear !! InshaALLAH v will do it !
koi thora sa guide hi krdy plzzzzzzzzz, koi sample code or smthng

All brothers cheery bhai ko pata hy sab unki mintain karo.

unhon ne bna li ho gi.

unki mintain karo wo de dain gi.

RSS

Today Top Members 

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

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

.