answersLogoWhite

0

#include<iostream.h>

#include<conio.h>

#include<alloc.h>

#include<stdio.h>

struct node

{

char name[10];

int bt;

int wt;

int tat;

struct node*next;

};

typedef struct node n;

n *start=NULL;

void main()

{

int i,m;

n *p,*temp,*t;

clrscr();

cout<<"\nEnter the number of Process:";

cin>>m;

for(i=0;i<m;i++)

{

p=(n*)malloc(sizeof (n));

cout<<"\n\tEnter the Process Name:";

cin>>p->name;

cout<<"\n\tEnter the Burst Time:";

cin>>p->bt;

if(start==NULL)

{

start=p;

start->next=NULL;

start->wt=0;

start->tat=start->bt;

}

else

{

temp=start;

while(temp!=NULL)

{

t=temp;

temp=temp->next;

}

t->next=p;

temp=p;

temp->wt=t->tat;

temp->tat=t->tat+temp->bt;

temp->next=NULL;

}

}

temp=start;

cout<<"\nProcesses\t\tBT\t\tWT\t\tTAT";

while(temp!=NULL)

{

cout<<"\n\t"<<temp->name;

cout<<"\t\t"<<temp->bt;

cout<<"\t\t"<<temp->wt;

cout<<"\t\t"<<temp->tat;

temp=temp->next;

}

cout<<"\n\n Created By:\n\tSanjog";

getch();

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is c plus plus program use to convert algorithm in to c plus plus program?

You can't convert an algorithm into code. That is the job of the programmer, not the language. Algorithm's are expressed in plain-English and typically use pseudocode to broadly demonstrate the implementation of the algorithm. However, it is the programmer's job to convert these algorithms into working code. Pseudocode isn't a programming language as such, but it uses structures and statements that are familiar to any programmer and can be easily translated into any language. However, pseudocode is not a standard so there are many different ways to present pseudocode to the programmer. Moreover, pseudocode is generalised and is far too generic to be converted directly into any one language, never mind C++, which can take advantage of the underlying hardware to produce more efficient algorithms than would otherwise be implied by the pseudocode alone. Hence the need for plain-English algorithms in conjunction with the pseudocode. Programmer's can process all this information far more easily than any computer can. Even if you could program a converter for one algorithm, there's no guarantee it would work for any other algorithm. The time spent programming an algorithm converter would be far better spent simply translating the algorithm yourself.


Algorithm of push and pop in c plus plus?

pop push c++ programming


Is there an answer book for the A plus program?

The A Plus Program is an initiative, not a test. So no, there is no answer book.


What is the only function all C plus plus programs must contain?

Every C plus plus program that is a main program must have the function 'main'.


A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999

Related Questions

How does algorithm and c plus plus program get along?

They are bosom-friends.


How do you write an Algorithm for a C plus plus Program?

You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.


Algorithms to the given c plus plus programs?

The question is impossible to answer. You cannot determine an algorithm from a given program if the program is not actually given in the question. Please place the program in the discussion section.


How can i write pseudo code for C plus plus if i haven't even wrote the program yet?

You are going about this backwards. First, define the program. Second, describe its algorithm. Third, if needed, write pseudo code. (Sometime, algorithm and pseudo code is the same process.) Fourth, or third, write real code.


What is c plus plus program use to convert algorithm in to c plus plus program?

You can't convert an algorithm into code. That is the job of the programmer, not the language. Algorithm's are expressed in plain-English and typically use pseudocode to broadly demonstrate the implementation of the algorithm. However, it is the programmer's job to convert these algorithms into working code. Pseudocode isn't a programming language as such, but it uses structures and statements that are familiar to any programmer and can be easily translated into any language. However, pseudocode is not a standard so there are many different ways to present pseudocode to the programmer. Moreover, pseudocode is generalised and is far too generic to be converted directly into any one language, never mind C++, which can take advantage of the underlying hardware to produce more efficient algorithms than would otherwise be implied by the pseudocode alone. Hence the need for plain-English algorithms in conjunction with the pseudocode. Programmer's can process all this information far more easily than any computer can. Even if you could program a converter for one algorithm, there's no guarantee it would work for any other algorithm. The time spent programming an algorithm converter would be far better spent simply translating the algorithm yourself.


Algorithm of push and pop in c plus plus?

pop push c++ programming


What is dry run in c plus plus terminology?

A manual check of the algorithm to ensure its correctness.


How do you check a user's text input in C plus plus?

Use an SLR parser algorithm.


How do you find a largest algorithm in c plus plus?

#define max (a, b) ((a) &gt;= (b)) ? (a) : (b)


Sample program of c plus plus by using an algorithm union?

The union of two data sequences is the combined set of both sequences. To create a union, copy the first data sequence then append the second to the copy. Both sequences must be of the same type.


How to restart c plus plus program?

Exit the program and relaunch it.


What is GCD in C Plus Plus?

A C++ implementation of the Binary GCD (Stern's) algorithm is shown in the Related Link below.