Pages

28 Jun 2012

IT430 1st GDB solution spring 2012

Soluton:

E-business is an emerging trend which is rapidly growing all over the world and only
those can survive in future who automate themselves and present them on internet to
connect with all over the world and to present in business anywhere anytime. E-business
is feasible in Pakistan but there is a need to convince and influence the people to be
involved in this technique and system because with the help of e-business they can
automate their business and they can effectively run their business with less hurdles and
problems. Pakistan has talent in every field as well as in IT field. The need is to use this
intellectual property and build infrastructure which will help to promote the internet and
e-business in our country and people can be prosperous by applying it because it is a need
of time and it is a great opportunity for them to be a part of this digital age.

27 Jun 2012

Mgt603 solved final term past paper's mega file

Here you can download mgt603 solved final term past paper's in one file....

Mgt603 solved final term past paper's mega file

Mgt602 solved final term past paper's mega file

Here you can download mgt602 solved final term past paper's in one mega file.......

Mgt602 solved final term past paper's mega file

Mgt402 solved final term past paper's

Here you can download mgt402 solved 5 final term past paper's in one file.... 

Mgt402 solved final term past paper's mega file 

Fin630 solved final term past paper's

Here you can download fin630 solved final term past paper's in one mega file.... 

Fin630 solved final term past paper's mega file

Fin623 solved final term past paper's

Here you can download Fin623 solved final term past paper's in one mega file...... 

Fin623 solved final term past paper's mega file

Cs507 solved final term past papers

Here you can download cs507 solved final term past paper's in one mega file... 

Cs507 solved final term past paper's

25 Jun 2012

Cs201 4th assignment soltuion spring 2012

Paste this code in C++
#include <iostream>
using namespace std;
class Location
{
int l1;
int l2;
public:
Location();
Location(int lon,int lat);
void view();
Location operator ++();
Location operator --();
void* operator new (size_t size);
void operator delete( void * ptr );
};
Location::Location()
{
l1=0;
l2=0;
}
Location::Location(int lon,int lat)
{
l1=lon;
l2=lat;
}
void Location::view()
{
cout<<endl<<"Longitude : "<<l1<<endl;
cout<<"Latitude : "<<l2<<endl<<endl;
}

void* Location::operator new(size_t size)
{
cout<<"Overloaded new operator called....." <<endl;
void * rtn = malloc (size ) ;
return rtn;
}
Location Location::operator ++()
{
++l1;
++l2;
}
Location Location::operator --()
{
--l1;
--l2;
}
void Location :: operator delete( void *memory )
{
cout<<"Overload delete operator called....."<<endl<<endl;
free( memory );
}
main()
{
system("cls");
Location l1(10,20), *l2= new Location(30,40);
cout<<endl<<"Coordinates for Location 1:";
l1.view();
++l1;
cout<<"After applying overloaded ++ operator on Location 1 : ";
l1.view();
cout<<"Coordinates for Location 2:";
l2[0].view();
--(*l2);
cout<<"After applying overloaded -- operator on Location 2 : ";
l2[0].view();
delete l2;
system("pause");

}


21 Jun 2012

Cs401 4th assignment soltuion spring 2012

Short this in your own words..

Solution:

In computing and in embedded systems, a programmable interval timer (PIT) is a counter which triggers an interrupt when it reaches the programmed count
PITs counters may be one-shot or periodic. One-shot timers interrupt only once, and then stop counting. Periodic timers interrupt every time they reach a specific value. This interrupt is received at regular intervals from the programmable interval timer. This interrupt is used to invoke kernel activities that must be performed on a regular basis. Counters are usually programmed with fixed increment intervals which determine how long the counter counts before it triggers an interrupt. The interval increments therefore determine the resolution for which the counter may be programmed to generate its one-shot or periodic interrupt
IBM PC compatible
The Intel 8253 PIT was the original timing device used on IBM PC compatibles. It used a 1.193182 MHz clock signal (one third of the color burst frequency used by NTSC, one twelfth of the system clock crystal oscillator) and contains three timers. Timer 0 is used by Microsoft Windows (uniprocessor) and Linux as a system timer, timer 1 was historically used for dynamic random access memory refreshes and timer 2 for the PC speaker.

Programmable Interval Timer (PIT)
Besides the Real Time Clock and the Time Stamp Counter, IBM-compatible PCs include another type of time-measuring device called Programmable Interval Timer(PIT). The role of a PIT is similar to the alarm clock of a microwave oven: it makes the user aware that the cooking time interval has elapsed. Instead of ringing a bell, this device issues a special interrupt called timer interrupt, which notifies the kernel that one more time interval has elapsed.[] Another difference from the alarm clock is that the PIT goes on issuing interrupts forever at some fixed frequency established by the kernel. Each IBM-compatible PC includes at least one PIT, which is usually implemented by an 8254 CMOS chip using the 0x40-0x43 I/O ports.
[] The PIT is also used to drive an audio amplifier connected to the computer's internal speaker.
As we'll see in detail in the next paragraphs, Linux programs the PIT of IBM-compatible PCs to issue timer interrupts on the IRQ 0 at a (roughly) 1000-Hz frequency that is, once every 1 millisecond. This time interval is called a tick, and its length in nanoseconds is stored in the tick_nsec variable. On a PC, tick_nsec is initialized to 999,848 nanoseconds (yielding a clock signal frequency of about 1000.15 Hz), but its value may be automatically adjusted by the kernel if the computer is synchronized with an external clock (see the later section "The adjtimex( ) System Call"). The ticks beat time for all activities in the system; in some sense, they are like the ticks sounded by a metronome while a musician is rehearsing.
Generally speaking, shorter ticks result in higher resolution timers, which help with smoother multimedia playback and faster response time when performing synchronous I/O multiplexing (poll( ) and select( ) system calls). This is a trade-off however: shorter ticks require the CPU to spend a larger fraction of its time in Kernel Mode that is, a smaller fraction of time in User Mode. As a consequence, user programs run slower.
The frequency of timer interrupts depends on the hardware architecture. The slower machines have a tick of roughly 10 milliseconds (100 timer interrupts per second), while the faster ones have a tick of roughly 1 millisecond (1000 or 1024 timer interrupts per second).
A few macros in the Linux code yield some constants that determine the frequency of timer interrupts. These are discussed in the following list.
HZ yields the approximate number of timer interrupts per second that is, their frequency. This value is set to 1000 for IBM PCs.
CLOCK_TICK_RATE yields the value 1,193,182, which is the 8254 chip's internal oscillator frequency.
LATCH yields the ratio between CLOCK_TICK_RATE and HZ, rounded to the nearest integer. It is used to program the PIT.
The PIT is initialized by setup_pit_timer( ) as follows:
spin_lock_irqsave(&i8253_lock, flags);
outb_p(0x34,0x43);
udelay(10);
outb_p(LATCH & 0xff, 0x40);
udelay(10);
outb
(LATCH >> 8, 0x40);
spin_unlock_irqrestore(&i8253_lock, flags);
The outb( ) C function is equivalent to the outb assembly language instruction: it copies the first operand into the I/O port specified as the second operand. The outb_p( ) function is similar to outb( ), except that it introduces a pause by executing a no-op instruction to keep the hardware from getting confused. The udelay() macro introduces a further small delay (see the later section "Delay Functions"). The first outb_ p( ) invocation is a command to the PIT to issue interrupts at a new rate. The next two outb_ p( ) and outb( ) invocations supply the new interrupt rate to the device. The 16-bit LATCH constant is sent to the 8-bit 0x40 I/O port of the device as two consecutive bytes. As a result, the PIT issues timer interrupts at a (roughly) 1000-Hz frequency (that is, once every 1 ms).
Solution:

an interrupt is a process or a signal that stops a microprocessor/microcontroller from what it is doing so that something else can happen. Let me give you an every day example. Suppose you are sitting at home, chatting to someone. Suddenly the telephone rings. You stop chatting, and pick up the telephone to speak to the caller. When you have finished your telephone conversation, you go back to chatting to the person before the telephone rang. You can think of the main routine as you chatting to someone, the telephone ringing causes you to interrupt your chatting, and the interrupt routine is the process of talking on the telephone. When the telephone conversation has ended, you then go back to your main routine of chatting. This example is exactly how an interrupt causes a processor to act. The main program is running, performing some function in a circuit, but when an interrupt occurs the main program halts while another routine is carried out. When this routine finishes, the processor goes back to the main routine again.
The PIC has 4 sources of interrupt. They can be split into two groups. Two are sources of interrupts that can be applied externally to the PIC, while the other two are internal processes. We are going to explain the two external ones here. The other two will be explained in other tutorials when we come to look at timers and storing data.
If you look at the pin-out of the PIC, you will see that pin 6 shows it is RB0/INT. Now, RB0 is obviously Port B bit 0. The INT symbolizes that it can also be configures as an external interrupt pin. Also, Port B bits 4 to 7 (pins 10 to 13) can also be used for interrupts. Before we can use the INT or other Port B pins, we need to do two things. First we need to tell the PIC that we are going to use interrupts. Secondly, we need to specify which port B pin we will be using as an interrupt and not as an I/O pin.
Inside the PIC there is a register called INTCON, and is at address 0Bh. Within this register there are 8 bits that can be enabled or disabled. Bit 7 of INTCON is called GIE. This is the Global Interrngupt Enable. Setting this to 1 tells the PIC that we are going to use an interrupt. Bit 4 of INTCON is called INTE, which means INTerrupt  Enable. Setting this bit to 1 tells the PIC that RB0 will be an interrupt pin. Setting bit 3, called RBIE, tells the PIc that we will be using Port B bits 4 to 7.  Now the PIC knows when this pin goes high or low, it will need to stop what it’s doing and get on with an interrupt routine. Now, we need to tell the PIC whether the interrupt is going to be on the rising edge (0V to +5V) or the falling edge (+5V to 0V) transition of the signal. In other words, do we want the PIC to interrupt when the signal goes from low to high, or from high to low. By default, this is set up to be on the rising edge. The edge ‘triggering’ is set up in another register called the OPTION register, at address 81h. The bit we are interested in is bit 6, which is called INTEDG. Setting this to 1 will cause the PIC to interrupt on the rising edge (default state) and setting it to 0 will cause the PIC to interrupt on the falling edge. If you want the PIC to trigger on the rising edge, then you don’t need to do anything to this bit. Now, unfortunately, the Option register is in Bank 1, which means that we have to change from bank 0 to bank 1, set the bit in the Option register, then come back to bank 0. The trick here is to do all of the Bank 1 registers in one hit, such as setting up the port pins, then coming back to Bank 0 when you are finished.
Ok, so now we have told the PIC which pin is going to be the interrupt, and on which edge to trigger, what happens in the program and the PIC when the interrupt occurs? Two things happen. First, a ‘flag’ is set. This tells the internal processor of the PIC that an interrupt has occurred.  Secondly, the program counter (which we mentioned in the last tutorial) points to a particular address within the PIC. Let’s quickly look at each of these separately.

Interrupt Flag

In our INTCON register, bit 1 is the interrupt flag, called INTF. Now, when any interrupt occurs, this flag will be set to 1. While there isn’t an interrupt, the flag is set to 0. And that is all it does. Now you are probably thinking ‘what is the point?’  Well, while this flag is set to 1, the PIC cannot, and will not, respond to any other interrupt. So, let’s say that we cause an interrupt. The flag will be set to 1, and the PIC will go to our routine for processing the interrupt. If this flag wasn’t set to 1, and the PIC was allowed to keep responding to the interrupt, then continually pulsing the pin will keep the PIC going back to the start of our interrupt routine, and never finishing it. Going back to my  example of the telephone, it’s like picking up the telephone, and just as soon as you start to speak it starts ringing again because someone else want to talk to you. It is far better to finish one conversation, then pick up the phone again to talk to the second person.
There is a slight drawback to this flag. Although the PIC automatically sets this flag to 1, it doesn’t set it back to 0! That task has to be done by the programmer – i.e. you. This is easily done, as We are sure you can guess, and has to be done after the PIC has executed the interrupt routine.

Memory Location

When you first power up the PIC, or if there is a reset, the Program Counter points to address 0000h, which is right at the start of the program memory. However, when there is an interrupt, the Program Counter will point to address 0004h. So, when we are writing our program that is going to have interrupts, we first of all have to tell the PIC to jump over address 0004h, and keep the interrupt routine which starts at address 0004h separate from the rest of the program. This is very easy to do.
First, we start our program with a command called ORG. This command means Origin, or start.  We follow it with an address. Because the PIC will start at address 0000h, we type ORG 0000h. Next we need to skip over address 0004h. We do this by placing a GOTO instruction, followed by a label which points to our main program. We then follow this GOTO command with another ORG, this time with the address 0004h. It is after this command that we enter our interrupt routine. Now, we could either type in our interrupt routine directly following the second ORG command, or we can place a GOTO statement which points to the interrupt routine. It really is a matter of choice on your part. To tell the PIC that it has come to the end of the interrupt routine we need to place the command RTFIE at the end of the routine. This command means return from the interrupt routine. When the PIC see this, the Program Counter points to the last location the PIC was at before the interrupt happened. We have shown below a short segment of code to show the above:
            ORG    0000h  ;PIC starts here on power up and reset
            GOTO  start    ;Goto our main program
            ORG    0004h  ;The PIC will come here on an interrupt
            :                     ;This is our interrupt routine that we
            :                     ;want the PIC to do when it receives
            :                     ;an interrupt
            RETFIE           ;End of the interrupt routine
            start               ;This is the start of our main program.
There are two things you should be aware of when using interrupts. The first is that if you are using the same register in your main program and the interrupt routine, bear in mind that the contents of the register will probably change when the interrupt occurs. For example, let’s you are using the w register to send data to Port A in the main program, and you are also using the w register in the interrupt routine to move data from one location to another. If you are not careful, the w register will contain the last value it had when it was in the interrupt routine, and when you come back from the interrupt this data will be sent to Port A instead of the value you had before the interrupt happened. The way round this is to temporarily store the contents of the w register before you use it again in the interrupt routine. The second is that there is a delay between when one interrupt occurs and when the next one can occur.

Mgt501 2nd GDB solution spring 2012

Solution:

After analyzing the above given scenario, it is noted that the employees of Pak IT left job even they were get high salaries as compare to market salaries on hiring. It leads to the assumption that the employees’ were not satisfied with their jobs because high salaries are not enough to retain employees. People demand more than salaries which increase motivation in people. After the study of Pak IT case I suggest some type of incentive system that will help to increase commitment and retention of employees in this company. These are following:
  1. Skill-based pay (pay-for-knowledge): Pay is based on work-related skills, not seniority or job performance.
  2. Creates incentives for employees to complete training, learn new skills, & become qualified to do additional jobs.
  3. Project Completion Rewards: Higher-level employees need recognition, but it should be tailored to the type of work they perform.
  4. Incentives for group accomplishments should be given as a group to strengthen teamwork.
  5. Profit sharing: some of the company’s profits are shared with the employees. This incentive will match the employee’s goals with company’s goals
  6. Merit pay: the employee’s annual pay increase is based on the employee’s job performance in the previous year

If Pak IT imposes these incentives system in its company it will increase the commitment and retention of employees in the company.

Mgt101 2nd GDB solution spring 2012

Plzzz dont copy past as it is.....

Soltuion:

The amount of Rs. 800,000 will charge in machine account. The freight and installation is directly connected to the machined. The cost incurred at the installation of the machinery due to the part got damaged, will also be charged in machinery account. Other than the training cost will not be charged as it is not the part of machinery since considered as the expense of preparation.

Mgt401 2nd GDB solution spring 2012

Solution:
Fair Value       = 100,000

Down Payment= 20,000
Interest Rate    = 9.5% P.A
Installments     = 6 half yearly

No. of InstallmentsLease RentalFinancial ChargesPrincipalPrincipal Outstanding
80,000
115,6363,80011,83668,164
215,6363,23812,39855,766
315,6362,64912,98742,779
415,6362,03213,60429,175
515,6361,38614,25014,925
615,63470914,9250
Total93,81413,81480,000

Eng201 2nd GDB solution spring 2012

Solutions:
1)      Correct grammar is an essential component of any good writing and although Hemingway and a few contemporary best sellers may take liberties with the language from time to time, until you have their stature and success, your best bet is to obey the rules of the road. For people who have been speaking it all their lives, English may seem like a pretty easy language, but in reality, it’s one of the most difficult to learn, not because of the complicated rules of grammar, but more often because of all the exceptions to all the complicated rules of grammar. It’s the common errors you should aim to avoid. They can change the meaning of what you’re writing and in the process make you look close to illiterate to your audience, which, of course, ruins your credibility and all those hoped-for book sales. The really tough grammatical stuff you can leave to your editor to dig out. If grammar is one of your weaknesses, consider involving one earlier in the process.
2)      what language you use to speak or write, using correct grammar not only helps you communicate more effectively and precisely, but also helps you avoid embarrassment. Around the world, correct grammar is an indication that the speaker or writer is an educated person who understands the nuances of the language, while grammar errors can indicate that you are not focusing on your words or, worse, that you do not understand the mechanics of your own language. Incorrect grammar can often lead to sentences that mean little or nothing. Native speakers rarely commit errors this gross when speaking, but non-native speakers often make errors that render their sentences incomprehensible. For example, an attempt to tell a taxi driver that you want to go to the mall might come out as "I wanted going mall," which means nothing (though a talented driver could figure out what the speaker is trying to say). The same happens when English-speakers try to speak in other languages whose grammar is unfamiliar. your grammar is good enough to make others understand what you mean, constant errors might give them the impression that you are not highly educated or that you are not paying attention to what you are saying or writing. Even if they otherwise would think highly of your words, your errors might simply distract them. Good grammar keeps your readers or listeners focused on what you have to say, not on how you are saying it or why you are making mistakes

14 Jun 2012

Mgt411 2nd GDB solution spring 2012

Is is just an idea.. don't copy past as it is.....
Solution:

An overvalued stock market will be the ultimate goal of every market participants. Everyone from the individual stock investor to the fund managers and government needed an overvalued stock market. Let us examine each and every one of them individually.

From an individual investor point of view, it is certainly not in the best interest for them to have an under-performing stock market. If the stock market persistently under performs other assets, then investors will pull out their investments from the stock market and invest in say money markets if they offer higher rates of return. So in order to prevent investors from pulling out of the market, the insiders and big money will always try to create an overvalued market.
Politicians need an overvalued stock market to gain popularity especially when election is around the corner. When the stock market is strong, no one will benefit more than the politicians. This is because when everyone is making money from the market, no one seems to care how the politicians run the economy even if they run it to the ground. The present government will surely be voted into office again even if there are corrupted to the core. The people who are able to influence the public are too occupied with making money and hence they will have less interest in who is running the country and who is being done to it. All they care is whether the market will continue going upwards.
Mutual funds managers and brokers also want an overvalued stock market because their earnings are based on commissions. Mutual fund manager’s income is based directly on the percentage of the funds valuation. The higher the valuation the more income they will receive. Mutual fund managers need an ever increasing market to keep selling their products to unsuspecting investors by telling them that the market will keep going up and making new highs.
Stock Broking firms too through their brokers always engaged in the so called ‘hyped-up selling’ of shares to their uninformed clients, telling them that every dip is an opportunity to accumulate more shares. This will nonetheless increase their earnings by doing more trades and hence more commissions.
Corporations also need an overvaluation of the stock market. The reason being most of the executives wealth are tied to their stock holdings in the company either through Employee Stock Option Scheme (ESOS) and Stock splits. So it is not in their interest to have a beat down stock market.
 

13 Jun 2012

Eng201 3rd assignment solution spring 2012


Assignment No. 3
Total Marks: 15
Due Date: 12/06/2012
Objective:
To assess students’ understanding of the course and to prepare them for the practical application of communication skills through writing practices.
Question No.1 (10)
You are required to write a feasibility report of preparing an interface to communicate with all the staff simultaneously. Being the manager of information technology department in a local company, write a feasibility report in order to convey the possibility and importance of the assigned project.
Solution:
Introduction:
As it is obvious, our company is maximizing its profits on regular basis for last 6 months or so. Having in mind that our company is just 8 months old, I don’t see this as a bad progress at all. Now coming straight to the point, I feel as if there should be a more flexible, reliable and speedy way to communicate with you. The reason is that apart from the data copied from vu solutions dot com fact that our company is growing day by day, we are having some draw-backs too. And these are in the form of distortion in establishing a perfect communication between me and you, the more we’ll be good at understanding each other, the more our company will prevail over its rivals.
Criteria and facts :
If we have a video conference luxury in our company , that will work as ice on cake. According to the British Evaluation’s 2011’s survey report : companies having a video conference room installed are progressing 30% faster than the ones not having it. So the (snow) difference is quite obvious. Having a video conference room in our company will be fruitful for us in many ways as I can have a discussion with all of you at the same time rather than calling you one by one into my office and providing you with the details. Moreover, it will save a lot of time and we can emphasize on our work in a better way.
Alternative, its overview and evaluation :
Or, we can have a weekly gathering in the main hall where I’ll be addressing all of you and you’ll be free to raise your point. But there are some flaws in this option as it requires additional management each week to make possible a successful meeting. Adding into this, we might miss some personals on a given day, and it is not a good idea to have a meeting when even twenty percent of your staff is missing, Now if we’ve got a video conference room, we can easily set up a meeting when-ever we want. So it’ll be more flexible to deal with personal absence and other technical issues if we are using video conference technology.
Conclusion and Recommendation:
Having listened to your views about my talk, and having presented what I had in my mind, I am more than sure that we should go for video conference technology to make the communication more relevant, clear, and fruitful. Who knows we’ll be having a technology in the coming days where we don’t even need to have video conference room installed to be addressed by the Managers or Employers at the same time, but I surely am not going to wait for that long, so let us give it up for video conference technology.
Question No.2 (5)
Distinguish as Adverb, Preposition or Conjunction, each of the italicized words in the following sentences.
1: He came before me.
2:He came two hours before.
3: He came before I left.
4: Have you ever seen him since?
5: I have not seen him since Monday.

Solution:
1: Preposition
2: Adverb
3: Preposition
4: Adverb
5: Preposition



12 Jun 2012

Mth302 solved final term past paper's

Mgt101 solved final term past paper's 5 mega files

Cs101 solved final term past paper's

Cs304 3rd assignment solution spring 2012

In this assignment you have to code/implement the below said classes in running form these classes are,
  • User
  • Listener
  • Administrator

Now for implementing these three classes practically in c++ you have to define classes according to the requirements given below:

  1. Implement data members and member functions for each class
  2. Implement constructor and destructor for each class
  3. Implement setters and getters functions for each class
Implement different type of relations between these classes

//Topic class
class topic{ // Data members of Topic class
int ID;
char  * Title;
char discription[200];
//Public interface of topic class
public:
//Default constructor
topic(){
ID=1;
Title=NULL;
}
//parametrized constructor
topic(int id, char *title){
ID=id;
Title=new char[strlen(title)+1];
strcpy(Title,title);
}
//setter function for ID
void setId() {
int id;
cout<<”\nEnter ID: “;
cin>>id;
}


Solution

/* CRRETE LISTENER CLASS ON YOUR OWN
AND MAKE CHANGES ACCORDING TO THE REQUIRMENT*/
#include
#include
using namespace std;
//Topic class
class user{
// Data members of Topic class
int ID;
char * Naam;
//Public interface of topic class
public:
//Default constructor
user(){
ID=1;
Naam=NULL;
}
//parametrized constructor
user(int id, char *naam){
ID=id;
Naam=new char[strlen(naam)+1];
strcpy(Naam,naam);
}
//setter function for ID
void setId() {
int id;
cout<<"\nEnter ID: ";
cin>>id;
}
void setNaam() {
char pChar[50];
cout< cin.getline(pChar,50);
Naam=new char[strlen(pChar)+1];
strcpy(Naam,pChar);
}
int getId(){
return ID;
}
char * getNaam(){
return Naam;
}
void trackplay()
{
cout<<"\nplay track\n";
}
~user(){
}
};
class admin: public user
{
char pass;
public:
void setpass()
{
cout<<"enter password";
cin>>pass;
}
void trackadd()
{
cout<<“\nadd track\n”;
}
void trackdel()
{
cout<<“delete track”< }
void trackup()
{
cout<<“update track\n”;
}
void artistadd()
{
cout<<“add artist\n”;
}
void artistdel()
{
cout<<“del artsit\n”;
}
void albumadd()
{
cout<<“add album\n”;
}
void albumdel()
{
cout<<“album delete\n”;
}
void albumup()
{
cout<<“update album\n”;
}
void addmc()
{
cout<<“add mc\n”;
}
void delmc()
{
cout<<“del mc\n”;
}
void upmc()
{
cout<<“up mc\n”;
}
~admin()
{}
};
main()
{
user uo;
uo.setId();
uo.setNaam();
uo.trackplay();
admin ao;
ao.setpass();
ao.trackadd();
ao.trackdel();
ao.trackup();
ao.artistadd();
ao.artistdel();
ao.albumadd();
ao.albumdel();
ao.albumup();
ao.addmc();
ao.delmc();
ao.upmc();
system(“pause”);
}

2 Jun 2012

Cs604 3rd assignment solution spring 2012


Question 1:
There are six processes given below with their run time units. Assume that all processes arrive in numerical order at time 0 then answer the questions given below:
Process ID CPU Requirements
P                        1    5
P                        2   4
P                       3    7
P                       4    1
P                      5     8
P                      6    10
Show the scheduling order for these processes under first-come-first-served, shortest-job first, and round-robin scheduling (quantum = 4).
Solution:
 FCFS = p1,p2,p3,p4,p5,p6

SJF = p4,p2,p1,p3,p5,p6

round  robin = p1,p2,p3,p4,p5,p6,p1,p3,p5,p6,p6
Question 2:
There are two processes that could take place even at the same time. One process helps in getting amount from the ATM and the second helps in depositing the money in the bank account through a cheque. You ensure mutual exclusiveness by using semaphore with wait and signal operations. Write pseudo-code or algorithm for these two processes.
Code for   Depositing Money process.
do
{
…………….
Deposit money in nextp
…………..
Wait (getting);
Wait(mutex);
………….
Deposit nextp to ATM
………
Signal(mutex);
Signal(deposit);
}
While(1);
Code for getting money process
do
{
Wait (deposit);
Wait(mutex);
………….
get money from ATM to nextc
………
Signal(mutex);
Signal(getting);
Get the money in nextc
………….
}
While(1);