VUsolutions Transferred to AchiKhasi.com

From December 2011, this blog www.VUsolutions.blogspot.com is transferred to http://achikhasi.com/vu/ . So, you may visit http://achikhasi.com/vu/ for latest study related help.

Back to home VUsolutions

VUsolutions Fans Club [join us for MORE solutions]

VUsolutions on Facebook

CS410 Assignment Solution

Saturday, January 22, 2011 Posted In Edit This
Visual Programming (CS410)
Assignment
Total marks = 20
Deadline Date = 21-01-2011

Please carefully read the following instructions before attempting the assignment. Rules for Marking
It should be clear that your assignment would not get any credit if:
  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • The assignment is copied. Note that strict action would be taken if the submitted assignment is copied from any other student. Both students will be punished severely.

1) You should concern recommended books to clarify your concepts as handouts are not sufficient. 
2) You are supposed to submit your assignment in .doc format. Any other formats like scan images, PDF, Zip, rar, bmp, docx etc will not be accepted
3) 
You are advised to upload your assignment at least two days before Due date.
4) This assignment file comprises of Two (2) pages.
5) 
Do not send the CPP file of your code, but paste the complete code in same document (.DOC) file in which you will solve other questions.
Important Note:

Assignment comprises of 20 Marks. Note that no assignment will be accepted after due date via email in any case (whether it is the case of load shedding or emergency electric failure or internet malfunctioning etc.). Hence, refrain from uploading assignment in the last hour of the deadline, and try to upload Solutions at least 02 days before the deadline to avoid inconvenience later on.
For any query please contact: [url=mailto:CS410@vu.edu.pk]CS410@vu.edu.pk[/url]

Q1 [Marks: 4+6]
Write about edit control default message processing and describe the default action against these messages. 

1.EM_CANUNDO 
2. 
EM_GETHANDLE 
3. 
EM_GETLIMITTEXT 

Q2 [Marks: 5+5]

Define Dynamic Link Libraries in detail? Also explain its relation with memory management?
....................
SOLUTION:

Define Dynamic Link Libraries in detail? Also explain its relation with memory management?



Dynamic-link library (also written without the hyphen), or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems. These libraries usually have the file extension DLL, OCX (for libraries containing ActiveX controls), or DRV (for legacy system drivers). The file formats for DLLs are the same as for Windows EXE files — that is, Portable Executable (PE) for 32-bit and 64-bit Windows, and New Executable (NE) for 16-bit Windows. As with EXEs, DLLs can contain code, data, and resources, in any combination.

In the broader sense of the term, any data file with the same file format can be called a resource DLL. Examples of such DLLs include icon libraries, sometimes having the extension ICL, and font files, having the extensions FON and FOT
Background for DLL
The first versions of Microsoft Windows ran every program in a single address space. Every program was meant to co-operate by yielding the CPU to other programs so that the GUI was capable of multitasking and could be as responsive as possible. All Operating-System level operations were provided by the underlying operating system: MS-DOS. All higher level services were provided by Windows Libraries Dynamic Link Libraries. The Drawing API, GDI, was implemented in a DLL called GDI.EXE, the user interface in USER.EXE. These extra layers on top of DOS had to be shared across all running windows programs, not just to enable Windows to work in a machine with less than a megabyte of RAM, but to enable the programs to co-operate amongst each other. The Graphics Device Interface code in GDI needed to translate drawing commands to operations on specific devices. On the display, it had to manipulate pixels in the frame buffer. When drawing to a printer, the API calls had to be transformed into requests to a printer. Although it could have been possible to provide hard-coded support for a limited set of devices (like the Color Graphics Adapter display, the HP LaserJet Printer Command Language), Microsoft chose a different approach. GDI would work by loading different pieces of code to work with different output devices—pieces of code called 'Device Drivers'.

The same architectural concept that allowed GDI to load different device drivers is that which allowed the Windows shell to load different windows programs, and for these programs to invoke API calls from the shared USER and GDI libraries. That concept was Dynamic Linking.

In a conventional non-shared, static library, sections of code are simply added to the calling program when its executable is built at the linking phase; if two programs call the same routine, the routine is included in both the programs during the linking stage of the two. With dynamic linking, shared code is placed into a single, separate file. The programs that call this file are connected to it at run time, with the operating system (or, in the case of early versions of Windows, the OS-extension), performing the binding.

For those early versions of Windows (1.0 to 3.11), the DLLs were the foundation for the entire GUI.
Display drivers were merely DLLs with a .DRV extension that provided custom implementations of the same drawing API through a unified Device Driver Interface (DDI).
The Drawing (GDI) and GUI (USER) APIs were merely the function calls exported by the GDI and USER, system DLLs with .EXE extension.

This notion of building up the operating system from a collection of dynamically loaded libraries is a core concept of Windows that persists even today. DLLs provide the standard benefits of shared libraries, such as modularity. Modularity allows changes to be made to code and data in a single self-contained DLL shared by several applications without any change to the applications themselves.

Another benefit of the modularity is the use of generic interfaces for plug-ins. A single interface may be developed which allows old as well as new modules to be integrated seamlessly at run-time into pre-existing applications, without any modification to the application itself. This concept of dynamic extensibility is taken to the extreme with the Component Object Model, the underpinnings of ActiveX.

In Windows 1.x, 2.x and 3.x, all windows applications shared the same address space, as well as the same memory. A DLL was only loaded once into this address space; from then on all programs using the library accessed it. The library's data was shared across all the programs. This could be used as an indirect form of Inter-process communication, or it could accidentally corrupt the different programs. With Windows 95 and successors every process runs in its own address space. While the DLL code may be shared, the data is private except where shared data is explicitly requested by the library. That said, large swathes of Windows 95, Windows 98 and Windows Me were built from 16-bit libraries, a feature which limited the performance of the Pentium Pro microprocessor when launched, and ultimately limited the stability and scalability of the DOS-based versions of Windows.

While DLLs are the core of the Windows architecture, they have a number of drawbacks, collectively called "DLL hell".[1] Currently, Microsoft promotes Microsoft .NET as one solution to the problems of DLL hell, although they now promote Virtualization based solutions such as Microsoft Virtual PC and Microsoft Application Virtualization, because they offer superior isolation between applications. An alternative mitigating solution to DLL hell has been the implementation of Side-by-Side Assembly.
Memory management
In Win32, the DLL files are organized into sections. Each section has its own set of attributes, such as being writable or read-only, executable (for code) or non-executable (for data), and so on.

The code in a DLL is usually shared among all the processes that use the DLL; that is, they occupy a single place in physical memory, and do not take up space in the page file. If the physical memory occupied by a code section is to be reclaimed, its contents are discarded, and later reloaded directly from the DLL file as necessary.

In contrast to code sections, the data sections of a DLL are usually private; that is, each process using the DLL has its own copy of all the DLL's data. Optionally, data sections can be made shared, allowing inter-process communication via this shared memory area. However, because user restrictions do not apply to the use of shared DLL memory, this creates a security hole; namely, one process can corrupt the shared data, which will likely cause all other sharing processes to behave undesirably. For example, a process running under a guest account can in this way corrupt another process running under a privileged account. This is an important reason to avoid the use of shared sections in DLLs.

If a DLL is compressed by certain executable packers (e.g. UPX), all of its code sections are marked as read-and-write, and will be unshared. Read-and-write code sections, much like private data sections, are private to each process. Thus DLLs with shared data sections should not be compressed if they are intended to be used simultaneously by multiple programs, since each program instance would have to carry its own copy of the DLL, resulting in increased memory consumption.

Mgmt630 GDB Announced

Saturday, January 22, 2011 Posted In Edit This
“Suppose you are working with Nokia corporation as a planning manager to control and allocate resources among different departments. What are the key areas where you should focus while going for strategic planning?”

CS615 GDB solution

Saturday, January 22, 2011 Posted In Edit This

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, 2011, 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.

"MONITORING AND CONTROLLING USING MEETINGS, REVIEWS AND REPORTS FOR COMMUNICATION WITH IN TEAM AND THE OUTSIDE WORLD IS BEst TECHNIQUE IN SOFTWARE PROJECT MANAGEMENT" Either you agree or disagree with given statement , justify your reply with sound arguments".

Note:
1. Books, websites and other reading material may be consulted before posting your comments. (Do not copy the material as it is from internet 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[url=mailto:CS615@vu.edu.pk]CS615@vu.edu.pk[/url]

......................

SOLUTION:

Project Management Monitoring and Controlling Tools & Techniques

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

CS201 Assignment No. 4 solution

Saturday, January 22, 2011 Posted In Edit This
Assignment No. 4

Semester: Fall 2010


CS201: Introduction to Programming
Due Date: 24th Jan, 2011

Problem Statement: Price manipulation


You are required to create a class in C++ named Price with the following Data members, Data members should be publicly declared.

  • Rupees
  • Paisas
The Price class presents Price in Rupees and Paisa. For instance, Price (10, 80) means 10 rupees and 80 paisas. The Price class should have the following features as described in detailed descriptions:

Detailed Description:


Constructors

Class Price must have

  • Default constructor, which must set Rupees and Paisas to zero.
  • Parameterized constructor that receives two parameters of type int and initializes its private data: Rupees and Paisas with them. Note that if Paisas are 100 or greater than 100 then also convert it in Rupees.
Member Functions
  • Create a function named Print()that displays the price of object in terms of rupees and paisas.
Operator overloading
  • A member function that overloads the + Operator to add two objects of Price.
There should be an overloaded + operators:

  • Add two objects and return Price object. Note that Paisas should not exceed 100.
  • Add first number into second objects and return Price object. Note that paisas should not exceed 100.
Output of your program should be as follows:

Price is 10 rupees and 60 paisas
Price is 12 rupees and 80 paisas

After Addition

Price is 23 rupees and 40 paisas
 ................
Solution:


#include <iostream.h>
#include <conio.h>
// This is only for IDEA, not a complete solution.
class price
{
public:
int rupees, paisas;
price () {};
price (int,int);
price operator + (price);
};

price::price (int x1, int y1) 
{
rupees = x1;
paisas = y1;
}

price price::operator+ (price money)
{
price convert;
convert.rupees = rupees + money.rupees;
convert.paisas = paisas + money.paisas;
return (convert);
}

int main () 
{
price x1 (10,60);
price y1 (13,2);
price z1;
z1 = x1 + y1;
cout <<"Price is "<<z1.rupees << " rupees " <<"and "<<z1.paisas<<" paisas";
getch();
return 0;
}

.........
#include <iostream.h>
class price{
//Declaring private data members
private:
int rupies;
int paisas; 
//Declaring public functions
public:
price(); //Default constructor
price (int,int); //Overloaded constructor
void Print(); //print function for displaying the array elements
price operator+(price); //Operator overloading function for operator +
};

// Default constructor
price::price()
{
rupies = 0; 
paisas = 0;
}

// Overload constructor
price::price(int crupies, int cpaisas)
{
rupies = crupies; 
paisas = cpaisas;
}

//Function to display the elements
void price::Print() 
{
cout<<" Price is "<<rupies<<" Rupees and "<<paisas<<" Paisas "<< endl;
}

// Function for + operator overloading 

price price::operator+(price d2) 
{
int r = rupies + d2.rupies; //adding rupeies
int p = paisas + d2.paisas; //adding paisas 
if (p>=100) //If paisas exceeds from 100 then adding a 
{
p-=100; // them into rupies
r++;
}
return price (r,p);
}

main()
{
price result;
price obj1(10, 60);
price obj2 (12, 80);
result = obj1+obj2;
obj1.Print();
cout<<"\n";
obj2.Print();
cout<<"\n";
cout<<"After Addition\n\n";
result.Print();
return 0;
}

...............

#include <iostream.h> // header file
#include <conio.h> 
using namespace std;
class price
{
public: // program public part 
int rupees, paisas;
price () {};
price (int,int);
price operator + (price);};
price::price (int x1, int y1) {
rupees = x1;
paisas = y1; }
price price::operator+ (price money) {
price convert;
convert.rupees = rupees + money.rupees;
convert.paisas = paisas + money.paisas;
return (convert); }
int main () {
price x1 (10,60);
price y1 (13,2);
price z1;
z1 = x1 + y1;
cout <<"\n\n\n\n\n\n\t\t<********( PRICE IS "<<z1.rupees << " RUPEES " <<"AND "<<z1.paisas<<" PAISAS )********>";
getch();
return 0;
system("pasure");
}

..............
#include <iostream.h>
#include <conio.h>
class price{

private:
int rupies;
int paisas; 

public:
price(); 
price (int,int); 
void Print(); 
price operator+(price); 
};


price::price()
{
rupies = 0; 
paisas = 0;
}


price::price(int crupies, int cpaisas)
{
rupies = crupies; 
paisas = cpaisas;
}


void price::Print() 
{
cout<<" Price is "<<rupies<<" Rupees and "<<paisas<<" Paisas "<< endl;
}


price price::operator+(price x) 
{
int r = rupies + x.rupies; 
int p = paisas + x.paisas; 
if (p>=100)
{
r=r+p/100;
p%=100;

}
return price (r,p); 
}

main()
{
price result;
price obj1(10, 60);
price obj2 (12, 80);
result = obj1+obj2;
obj1.Print();
cout<<"\n";
obj2.Print();
cout<<"\n After Addition\n\n";
result.Print();
getch();
return 0;
}

Back to home VUsolutions

Shaadi.com: Just create ur account & find ur partner or EARN money, its reall & EASY

VUsolutions Followers (Join NOW and Get Extra Benefits)

Install LATEST toolbar having lot of features - GET solutions on Desktop

toolbar powered by Conduit
Caliplus 300x250 NoFlam VitoLiv 468x60 GlucoLo