CS201 Assignment 5 SOLUTION

Assignment No. 5
Semester: Fall 2010
CS201: Introduction to Programming
Total Marks: 20

Due Date: Jan 31st  ,2011

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.

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

§         User defined manipulators
§         Static member
§         Copy Constructor

§         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.


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.

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


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


/*YASIR JAVAED MC090200982*/

using namespace std;

class CRectangle
              // Rectangle class is CRectangle. it is private nobody can make rectangle without its attributes.
              // Data members are
              int iBot;
              int iTop;
              int iLeft;
              int iRight;

              // Static variable to ensure rectangles calculate.
              static int rectCount;

              // Constructor of the class CRectangle.
              CRectangle(int bottom,int top,int left,int right)
                          iBot = bottom;
                          iTop = top;
                          iLeft = left;
                          iRight = right;

              // Dynamic Copy constructor of the class.
              CRectangle(const CRectangle& lhs)
                          iBot = lhs.iBot;
                          iTop = lhs.iTop;
                          iLeft = lhs.iLeft;
                          iRight = lhs.iRight;
              // Destructor of the class.

              // Function to compute and obtain area of a rectangle.
              long Area()
                   return(long)( abs(iTop-iBot) * abs(iLeft-iRight) );

int CRectangle::rectCount=0;

int main ()
    CRectangle rect1 = CRectangle(0,80,0,80);
    CRectangle rect2 = CRectangle(0,70,0,80);
    cout<<"Area of rectangle 1 is "<<rect1. Area()<<endl;
    cout<<"\nArea of rectangle 2 is "<<rect2. Area()<<endl;
    cout<<"\nThe number of rectangles is "<<CRectangle::rectCount<<endl;

         CRectangle rectCopied = CRectangle(rect1);
         cout<<"\nAfter using copy constructor, total number of rectangles is "<<CRectangle::rectCount<<endl;

    cout<<"\nThe number of rectangles is "<<CRectangle::rectCount<<endl;

    return 0;


CS615 GDB Solution

Total Marks 5
Starting Date Thursday, January 27, 2011
Closing Date Friday, January 28, 2011
Status Open

Graded Moderated Discussion Board (Graded MDB)
 Dear students a Graded Moderated Discussion Board will be opened for “Software Project Management (CS615)” from July 27, 2010 to July 28, 2010, in which you have to post your comments on the topic given below and it will have weight-age of 5% of your total subject marks. Your comments will be graded based on the logic you have used to support your answer.
1.      Books, websites and other reading material may be consulted before posting your comments. (Do not copy the material as it is from net and other resources.) If any one found copying the answer of other students or from any web site will get zero marks for his/her attempt.
2.      Your comments must not exceed more than 7 lines.
3.      Try to come up with your own arguments so that you could get maximum benefit from this exercise.
4.      Short and to the point comments will be preferred over lengthy comments.
5.      You should post your comments on the Graded MDB & not on the Regular MDB. Both will run parallel to each other during the time specified above. Do not post multiple comments.
6.      Be careful for you may loose GMDB comments due to electricity load shedding and internet problems. You cannot participate in the discussion after the due date or through e-mail with in specified time.
7.      Your answer should contain important points. Also follow the instructions given in announcement.
You can start preparing your comments now.
In case of any query mail at CS615@vu.edu.pk



Monitoring and Controlling a project is the process or activities whereby the project manager tracks, reviews and revises the project activities in order to ensure the project creates the deliverables in accordance with the project objectives. Because of the unique and temporary nature of projects, they require active control. Unlike a process where the same set of activities have been performed repeatedly so that habits and expectations are stable, a project is inherently unstable. The activities are unique to the project or the sequence of activities and resources are only temporarily assigned associated with the project and are redeployed when the project completes. Habits and patterns are not established before everything changes.

The primary results of the Monitoring and Controlling processes are the project performance reports and implementing project changes. The focus for project management is the analysis of project performance to determine whether a change is needed in the plan for the remaining project activities. In my experience, almost every project will require a change to the plan at some point in time. Traditional projects are the most stable projects because the requirements and the activities are clear and well understood. Adaptive and Extreme projects are the least stable. They require very close control and will require numerous changes - if for no other reason the project manager will need to refine the activities of later phases based upon the results of early activities.
Tools and techniques that are used by project managers to conduct the Monitoring and Controlling of a project fall into one of four general categories. The first is the collection of project performance information. Techniques supporting this category are Pulse Meetings, Variance Reports, and Program Reviews. The second category is the analysis of the project performance to determine whether a project change is needed. Techniques that are used in this category are Project Forecasting and Problem Solving. The third category is reporting on project performance. Techniques that support this activity include the use of a Project Management Information System, Management Reviews, and Dashboards. The final category is the management of project change. The technique I commonly use in this category is the maintenance of a Change Management Log. There are two areas of project management tools and techniques that closely support the Monitoring and controlling process but are also used more broadly throughout the project lifecycle. These are important enough to justify their own page.
Program Reviews
Program Reviews are meetings with the project team members that review the current status of the project as compared to the original project plan. These are most often used on Full-scale and Complex projects. Unlike the Pulse Meetings which focus on day-to-day activities, the Program Reviews focus on the big picture and emphasize the integration between activities and between sub-projects encompassed within the project. The question being asked is whether the project activities and the sub-projects are likely to interfere with each other. In addition, when I have a supplier who is a major contributor on the project and is performing customized work on this project, I will conduct Program Reviews with the supplier for their portion of the project. Program Reviews are sometimes combined with Management Reviews. The danger with this approach is that key stakeholders and managers may intimidate some project team members from providing a frank and honest appraisal of status.


Monitoring and controlling a project is the system or activities. In it project manager record, analysis and modify the project activities in order to make sure project create in on time and according to the project objectives. The short term or temporary nature of projects they require active control because they create with different activities and requirements. in this type also required to communicate with the team and outside the world so to do required modification in software project In the other side long term or constant project where the same sets of activities execute frequently this type of project is much easier to handle because all the activities and requirements are constant and not required too much active control. In this type all the team members not necessary to communicate the each other and outside the world also.


VU Notice

Published On:  Wednesday, January 26, 2011

Overseas Exam Software Installation and Configuration

New Overseas Exam Software and related material has been made available for download. You must follow the sequence of instructions given below for smooth and error free installation:


1.     Visit the link http://qb.vu.edu.pk

2.     For downloading, login with your VULMS student ID and password

3.     Download all material one by one

4.     After installation, you must go through the “User Manual” to know how to attempt your paper. 
5.     Once the installation is completed successfully, an icon will be visible on your desktop. Please click the icon to run demo test. (demo test is available till 8th Feb 2011. You may test your installation by joining each of the following sessions till 8th Feb 2011 during the specified timings)

Session 1:         07:30 AM to 09:30 AM           Pakistan time
Session 2:         10:30 AM to 12:30 PM           Pakistan time
Session 3:         02:00 Noon to 04:00 PM        Pakistan time
Session 4:         05:00 PM to 07:00 PM           Pakistan time

6.     Please use your student ID as login and password for login the exam application to check demo test. For example
StudentID: mc090XXXXXX
Password:  mc090XXXXXX (use the same Id as password for demo exam application)

7.     After completing the demo test, you must confirm your installation status by clicking the link “Click here to confirm your installation status” given on http://qb.vu.edu.pk

In case of any query/problem, you may give your feedback to overseasexams@vu.edu.pk or contact us on the following numbers during VU office hours i.e. 09:00-05:00



VU Notice

Published On:  Saturday, January 22, 2011
All VU students who are enrolled in Fall 2010 Semester and have not yet made their Final Term Exam date sheet are encouraged to appear in the Fall 2010 Final Term Examination by sending an explicit request at datesheet@vu.edu.pk on or before 27th January 2011.

Upon receipt of their email request on or before Jan 27, 2011 their exam date sheet will be designed by Examination Department according to the availability of seats/slots/exam centers. For this Rs.500/= will be charged as Late Exam Date Sheet Fee payable by the students in their forthcoming issued fee challan form.

VU Notice

Published On:  Tuesday, January 18, 2011

The intended participants may send their “ESSAYS” to the undersigned by February 28, 2011.
 Director Kashmir Committee,
Mr.Sultan Ahmad,
Room # 427, 4th floor, Parliament House,
Tel: 051-9201972, 9022454

VU Notice

Published On:  Monday, January 17, 2011
Important Instructions: Fall 2010 Final Term Examinations
1.      For every paper, you must carry your VU Id Card and “Exam Entrance Slip” for entering the Examination Hall.
2.      You shall be responsible for any loss of examination time for not having these documents.
3.      You shall report at the Exam Center 15 minutes before the starting time of your paper.
4.      You shall not be allowed to carry a mobile phone (even in offline mode) in the Examination Hall.
5.      You must not carry any type of helping material (Hard/Soft) in the Examination Hall.
6.      You must avoid disturbing the peace in and around the Examination Hall.
7.      Strict disciplinary action such as cancellation of the paper(s) and registration of umc etc shall be taken against the violators 
NOTE: Students entry in the examination hall will be banned 15 minutes after the start of paper.


VU Notice

Published On:  Friday, January 14, 2011
As announced earlier, the web interface for making your date sheet is being placed on the following link:http://datesheet.vu.edu.pk/ 
Note: You MUST make your date sheet on or before:  Friday, January 21, 2011. Seats will be available on a 'first come first served' basis.

  1. Logon using your VULMS ID and Password (In case of any password related problem contact at password@vu.edu.pk)
  2. Choose Your Exam City in which you want to appear for Exam (optional)
  3. Choose your Exam Center out of the centers available to you(Once selected, you can not change your Exam Center)
  4. Select available exam date and start time of your own choice for each of your courses, then click “Confirm” button to confirm your selection.
  5. Repeat the Step-4 for all your remaining courses one by one.
  6. Finally click the button at the bottom of the page to get Examination Password and print your Examination Slip which you MUST keep with you for entry in Examination Center on each of the Exam Dates.

VU Notice

Published On:  Friday, December 24, 2010
VU has launched a new segment on its television channel, "Lecture on Demand". Now you can select and watch the lectures of your choice. To avail the opportunity, simply vote via email at lod@vu.edu.pk or sms to the number 0333-4881304 and demand any lecture from the preceding week. The details of the lectures will be available on your TV screens on the LOD bars.  Right after the countdown ends the most voted lecture will be telecast. This exclusive lecture broadcast is available on VTV1 on Saturdays at 12:00 noon, 3:00 pm and 6:00 pm starting from the 1st of January, 2011. Do not miss this unique opportunity and access the resource of knowledge the way you want it. 


VU Notice

Published On:  Thursday, December 02, 2010
Announcement: As per Higher Education Commission (HEC), Islamabad “PARENTS ALERT!” message dated November 28, 2010 published in National Newspapers, reproduced as under. Virtual University of Pakistan encourages all its enrolled (upto spring 2010) 2-year MBA students to complete their studies at the earliest.

VU Notice

Published On:  Tuesday, November 30, 2010

All overseas students who are facing difficulties in installation of VU Exam Software on 64 bit windows platform are advised to download and install the relevant version of VU Exam Software from the following link:

A step by step guide for installation of exam software is also provided.


VU Notice

Published On:  Friday, November 26, 2010
Dear Students,

Your Student ID and password gives you access to your LMS and VU email accounts. If someone else obtains your password which is your personal digital key, he/she can use your account to access your private data, including your personal profile, emails, assignments, MDB, GDB, Quizzes and can alter your secret information to retrieve forgotten password. Further more, he/she may perform illegal activities in your name and will remain undetected, unless you eventually change your password. You are advised to treat your password(s) as confidential information not to share with anybody.  Follow the guidelines below to protect your LMS and VU Email accounts from unauthorized access.

  • You are YOURSELF responsible for the security of your LMS and VU Email passwords and login credentials.
  • Do not share your passwords with anybody.
  • Make separate passwords for LMS and VU Email accounts respectively.
  • Do not use Remember Password feature of internet browser.
  • Change your LMS and VU Email passwords at least once a week and immediately whenever you feel someone might know your password.
  • Do not re-use your old passwords.
  • Passwords should not be based on personal information including name, birthday, address, phone number, etc.
  • Password should be at least 8 characters long, easier for you to remember but harder for someone else to guess. 
  • Password should be a non-dictionary word containing upper and lowercase letters, numbers and special characters.
Contact password@vu.edu.pk for further assistance.
VU IT Department

VU Notice

Published On:  Tuesday, September 28, 2010
The students are not allowed to deposit/handover their fee to the PVCs. If any student hands over fee to the PVC, the University will not be responsible for any claim of the student.


CS615 Assignment No 5 SOLUTION

Software Project Management
Assignment # 05
Fall 2010
                                                               Marks: 20
Due Date
Your assignment must be uploaded before or on 31st
 January 2011.

Uploading instructions:
Please view the Assignment Submission Process document provided to you by
the Virtual University for uploading assignments.
•  Assignment should be in .doc format.
•  Save your assignment with your ID (e.g. bx020200786.doc).
•  Assignment submission through email is highly discouraged.

Rules for Marking:
It should be clear that your assignment will not get any credit if:
•  The assignment is submitted after due date.
•  The submitted assignment file is corrupted.
•  The assignment is copied.
Your answer must follow the below given specifications. You will be assigned zero
marks if you do not follow these instructions.
•   Font style: “Times New Roman”
•   Font color: “Black”
•   Font size: “12”
•  Bold for heading only.
•  Font in Italic is not allowed at all.
•  No formatting or bullets are allowed to use.


Q. 01 How a change process carried out in a projects?  Also differentiate among its
different stages? [Your answer should be precise and to the point]

Q. 02 In table 1.0 given below indicates estimated inputs, outputs, inquiries, files
and external interfaces for software. The given table 1.1 indicates the values
from F1-F14 values?
Table 1.0:

 Optimistic Realistic Pessimistic Average
Complexity Factor
No. of Inputs 14 18 24 3
No. of Outputs 12 14 20 4
No. of Inquiries  12 16 22 3
No. of Files 5 5 6 8
No. of Interfaces 3 3 4 6

Table 1.1:

14 Question for
F1 to F14

F1 5
F2 5
F3 4
F4 6
F5 3
F6 4
F7 0
F8 5
F9 6
F10 8
F11 8
F12 6
F13 5
F14 5
114 FF − = ∑  70

Calculate the No. of Function Point (FP),  if the organizational productivity for the
system of this type is 14 FP/month & labor rate is Rs. 6000/month then compute
Cost / FP, total estimated project cost and estimated effort in Person Month (PM).  



Question No 1
How a change process carried out in a projects?  Also differentiate among its different stages?

In The transform Management method is the system used to begin, record, measure, endorse and decide project modify. Project changes are necessary when its judge necessary to change the scope, time or cost of one or more before standard project deliverables. Mainly change will influence the financial plan and timetable of the project. The use of the recognized change management process will be compulsory when any changes are revealed. Conclusion to analyze and result to carry on with changes will be made by the Client Manager and the Project Manager if they do not collision between scope budget and schedule. Changes which do impact forwarded to the Steering Committee for reconsider. The Steering Committee may make a decision that managerial Sponsor sanction and review is mandatory earlier than making a judgment.

There are different stages which areas under:

Identify (recognize and record documents what is required change)
Validate (confirm the change is applicable and need management)
Analyze (monitor the cost, efforts impact of change record timetable)
Control (come to a decision whether to perform the change)
Action (execute decision)
Close (confirm that action is complete)

Question No 2
In table 1.0 given below indicates estimated inputs, outputs, inquiries, files and external interfaces for software. The given table 1.1 indicates the values from F1-F14 values?


Sensibly if we divide our software application into parts it will always come to one or more of the 5 functionalities. A software application cannot be copied without using any one of the functionalities.
Once the TDI is determined we can put it in the formula below to get the VAF.
VAF = 0.65 + (0.01 * TDI)
Finally the Adjusted Function Points or Function Points are
Now these FP's can be used to determine the Size of the Software, also can be used to quote the price of the software, get the time and effort required to complete the software.
Effort in Person Month = FP divided by no. of FP's per month
Schedule in Months = 70* 14/month
Optimal Schedule = 70 * 46^1/3 ~ 12 months
Optimal Team Size = 65 / 12 ~ 5 or 6 persons. 

CS610 Assignment 5 Solution

CS 610 Computer Networks
Assignment # 05
Fall 2010
Total Marks = 20

Your assignment must be uploaded / submitted before or on January 31, 2011.

Upload Instructions
Please view the assignment submission process document provided to you by the
Virtual University.

Rules for Marking
Please note that your assignment will not be graded if:
It is submitted after due date
The file you uploaded does not open
The file you uploaded is copied from someone else or from internet
It is in some format other than .doc


The assignment has been designed to enable you develop the understanding about the transport protocols and network address translation.

Note: Material that is an exact copy from handouts or internet would be graded
zero marks. Your solution should consist of the material found through different sources and written in your own words.

Assignment Statements:

Q1. Differentiate between internet protocol and transport protocol with the help of examples.
                                                                                                    (10 Marks)

Q2. Describe the pros and cons of NAT?
                                                                                                    (10 Marks)



Q1. Differentiate between internet protocol and transport protocol with the help of examples. (10 Marks)

Helping Material:-

Internet Protocol
The Internet Protocol (IP) is the principal communications protocol used for relaying datagrams (packets) across an internetwork using the Internet Protocol Suite. Responsible for routing packets across network boundaries, it is the primary protocol that establishes the Internet.

IP is the primary protocol in the Internet Layer of the Internet Protocol Suite and has the task of delivering datagrams from the source host to the destination host solely based on their addresses. For this purpose, IP defines addressing methods and structures for datagram encapsulation.

Historically, IP was the connectionless datagram service in the original Transmission Control Program introduced by Vint Cerf and Bob Kahn in 1974, the other being the connection-oriented Transmission Control Protocol (TCP). The Internet Protocol Suite is therefore often referred to as TCP/IP.

The first major version of IP, now referred to as Internet Protocol Version 4 (IPv4) is the dominant protocol of the Internet, although the successor, Internet Protocol Version 6 (IPv6) is in active, growing deployment worldwide.

Q2. Describe the pros and cons of NAT?

 Network Address Translation or NAT is a technique that allows the translation of local network addresses or the internal IP addresses (used within an organization) into globally unique IP addresses that help identify an online resource in a unique manner over the Internet. The process is also referred to as Network Masquerading or the Native Address Translation. Network Address Translation allows multiple resources within an organization or connected to a local LAN to use a single IP address to access the Internet. The idea of Network Address Translation is very simple indeed. It essentially abstracts internal addressing from the global IP addressing used over the Internet. This abstraction allows helps the network resources to get over a shortage of the address space by mapping relatively few real IP addresses to the abundant local IP addresses created locally by the Proxy server for addressing purposes. It allows the use of different addresses over the local and global level and local sharing of IP addresses over the Internet.
An increasing usage of the Network Address Translation was a direct result of the limited address space offered by the erstwhile Internet protocols such as the IPv4 that carried the bulk of the Internet traffic. NAT became a popular mechanism to overcome the shortage of unique IP addresses for individual network resources over the Internet. The Network Address Translation protocol maps the internal addresses to the real IP addresses that are required for communication process over the Internet.

                         Types of NAT:

1.Full Cone NAT The term Full Cone NAT is also commonly referred known as one-to-one NAT. Full Cone NAT allows the mapping of various external (non local) address ports to the corresponding internal addresses ports in a symmetrical manner. 

2.Restricted Cone NAT This allows the local IP address and port number to be mapped to a particular external IP address and port number respectively. The relative mapping in the internand external domains is not disturbed in the Restricted Cone network address translation. 

3.Port restricted cone NAT As the name suggests, the Port restricted cone NAT restricts the portnumbers that are used for communication purposes over the Internet. All the external communication is directed to particular communication port except if there is a continuous communication with an application over a specific communications port. 

4.Symmetric NAT The communication process directed outwards is mapped to a unique externaladdress along with a port number. This scheme imparts a logical symmetry to the process of external network access by the resources connected to the LAN.

In actual practice a pure NAT implementation is rarely used. Rather, a combination of the above
types is implemented to achieve the desired network configuration



Q1. Differentiate between internet protocol and transport protocol with the help of examples.


TCP is also called or known as Transmission Control Protocol. It is main protocol of the Internet Protocol collection. Internet Protocol is also called IP. The Internet Protocol (IP) is the primary communications protocol used for transmit datagram which is packets. Accountable for steering packets across network limitations. The two major concern of TCP are the two end systems. First are web browser and second one is web server.
For example,
TCP give the release of a stream of bytes from a program from one computer to another computer. TCP is also responsible of controlling size, flow control, the rate of data exchange, and network traffic blocking.
The first major version of IP is as Internet Protocol Version 4 (IPv4). It is the leading protocol of the Internet and in the other side Internet Protocol Version 6 (IPv6) is in rising operations globally.

TCP offer communication services at a middle level among an application program and the IP. Its indicate that when an application program wants to send a large piece of data across the internet using the Internet Protocol in its place of breaking the data into sizes that will fit the IP and using a sequence of requests from the IP. The software is able to issuing a single request to TCP and allows to protocol handle the information of the IP transfer. TCP sense problems that occur in the IP Requests retransmission of the packets that were lost reorganize the order of the packets. Now they are put reverse into their appropriate order and help to reduce network.

·     TCP is main operating on a comparatively high level and IP work at a lower level.

·     TCP gives communication services at an intermediate level between an application program and the IP. IP encapsulates all data and is connectionless.

·     TCP is the protocol that major Internet applications rely on applications such as the WWW, email, and file transfer.

Q2. Describe the pros and cons of NAT?


NAT or Network Address Translation is a method that permits the conversion of local network addresses or the private IP addresses used within an LAN into worldwide matchless IP addresses that help recognize an online resource in a unique manner on Internet. An upward usage of the NAT was limited address space offered by the previous Internet protocols such as the IPv4. NAT turn into a popular system to overcome the lack of unique IP addresses. The NAT protocols plot the private addresses to the valid IP addresses that are necessary for communication process over the Internet.

NAT Pros and Cons:
Network Address Translation does not allow a true end-to-end connectivity that is necessary by some real time applications. An amount of real-time applications require the formation of a logical tunnel to swap the data packets rapidly in real-time. It needs a fast and faultless connectivity of any mediators just like proxy server that inclined to make difficult and slow down the connections process.
NAT creates difficulties in the performance of Tunnelling protocols. Any communication that is routed through a Proxy server be likely to reasonably slow and prone to trouble. Positive significant applications offer no space for such shortfall.
Examples telemedicine, teleconferencing. Like this applications find the process of network address translation as a block in the communication network creating preventable twist in the end-to-end connectivity.
NAT do something like out of work channel in the online communication over the Internet. The two causes for the extensive fame and following acceptance of the network address translation process were a lack of IPv4 address space and the safety fear. These concerns have been fully satisfied in the IPv6 protocol. In the IPv6 gradually substitute the IPv4 protocol. The NAT process will turn into out of work and worthless even as consuming the limited network resources for providing services that will be no longer required over the IPv6 networks