Preview

Nt1310 Unit 3 Assignment 1 Network Analysis

Better Essays
Open Document
Open Document
401 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Nt1310 Unit 3 Assignment 1 Network Analysis
#include
#include

float avg_wt,avg_tt; int i = 0,ttl_wt=0,ttl_tt=0,qt;

struct process
{
int prn; char type; int bt; int wt; int tt; struct process *nxt;
}*stfor,*stbck,*np,*endfor,*endbck,*temp;

void ins_node(struct process *np)
{
if(np->type == 'f') { if(stfor == NULL) stfor = endfor = np; else { endfor->nxt = np; endfor = np; } } else { if(stbck == NULL) stbck = endbck = np; else { endbck->nxt = np; endbck = np; } }
}

void del_node(struct process *np,int choice)
{
if(np->type == 'f') { if(stfor == endfor) stfor = NULL; else stfor = stfor->nxt; if(choice == 1) delete np; } else { if(stbck == endbck) stbck = NULL; else stbck = stbck->nxt; delete np;
…show more content…

: "); ch = getche(); }while(ch == 'y' || stfor == NULL);
}

void
…show more content…

printf(" %d \t\t %d\n\n",stfor->wt,stfor->tt); ttl_wt += stfor->wt; ttl_tt += stfor->tt; temp = np = stfor; del_node(np,1); ++i; } else { stfor->bt -= qt; stfor->tt = temp->tt + qt; printf(" %d \t\t %d\n\n",stfor->wt,stfor->tt); np = temp = stfor; del_node(np,2); ins_node(temp); } }while(stfor != NULL);
}

void FCFS()
{
getch(); printf("\n\n Background FCFS Process Scheduling \n\n"); printf("\n\n Process Burst Time Waiting Time Turnaround Time \n"); printf(" ------------------------------------------------------- \n"); do { printf(" %d \t\t %d \t\t",stbck->prn,stbck->bt); stbck->wt = temp->tt; stbck->tt = temp->tt + stbck->bt; printf(" %d \t\t %d\n\n",stbck->wt,stbck->tt); ttl_wt += stbck->wt; ttl_tt += stbck->tt; temp = np = stbck; del_node(np,1); ++i; }while(stbck != NULL);

} void main()
{
clrscr(); printf("\n Enter the Quantum time for Foreground Process : "); scanf("%d",&qt); ins_dat(); if(stfor != NULL) Round_Robin(); if(stfor == NULL && stbck != NULL) FCFS(); avg_wt = (float) ttl_wt/i; avg_tt = (float) ttl_tt/i; printf("\n\n Average Waiting Time : %f",avg_wt); printf("\n Average Turnaround Time : %f",avg_tt); getch();


You May Also Find These Documents Helpful

  • Good Essays

    Nt1310 Unit 3 Assignment 1

    • 1410 Words
    • 6 Pages

    Don’t limit yourself to modular sizes listed in a catalog - surf2 tables are available in 1 inch…

    • 1410 Words
    • 6 Pages
    Good Essays
  • Good Essays

    c) An analog and digital signal is used to reduce the effects of attenuation for a digital transmission signal.…

    • 598 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    CODE FOR THE ABOVE FRAGMENT addi $t6, $zero, 101 # the loop termination value add $t0, $zero, $zero # i = 0 addi $t2, $a0, 0 # ptr to current A[i] addi $t3, $a1, 0 # ptr to current B[i] loop: lw $t4, 0($t3) # load B[i] add $t4, $t4, $s0 # B[i] + c sw $t4, 0($t2) # store in A[i] addi $t0, $t0, 1 # i++ addi $t2, $t2, 4 # ptr to next A[i] addi $t3, $t3, 4 # ptr to next B[i] bne $t0, $t6, loop # if i < 101, goto loop IF ANY QUERIES REGARDING CODE…

    • 107 Words
    • 1 Page
    Powerful Essays
  • Satisfactory Essays

    cout << num1 << " + " << num2 << " = " << num1+num2;…

    • 426 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    There are two very important tools to use in Networking. They are Domain Name System (DNS) and Dynamic Host Configuration Protocol (DHCP). These help keep your Network organized while building it. A DNS is a system used to name computers and network services that is organized into a hierarchy of domains. It can help locate computers and services through user names. Dynamic Host Configuration Protocol allows a server to automatically assign IP addresses to a computer from a certain range of numbers configured for that network. These two tools work as the foundation for IT-Management.…

    • 370 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Do you want to permit remote access to your monitor or access your monitor only at the console?…

    • 95 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    Nt1310 Unit 3 Assignment 1

    • 3299 Words
    • 14 Pages

    Magnifier will allocate a section of your screen (by default at the top) where it will display a magnified version of what is under your mouse. It is also possible to configure it to follow the keyboard focus instead of the mouse position.…

    • 3299 Words
    • 14 Pages
    Good Essays
  • Good Essays

    According to the analysis of the Problem, Controllers have knowledge about their interdomain nodes and status links .Its avoid the loop in their domain and compute the optimized path for their domain but on the egress port and out from the domain it can’t compute the path.…

    • 694 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Nt1310 Unit 3 Assignment 1

    • 1398 Words
    • 6 Pages

    Assignment: If you are considering the purchase of a smartphone, or already own one, visit the website listed under Resource to learn about the best camera phones, and answer the following questions:…

    • 1398 Words
    • 6 Pages
    Good Essays
  • Good Essays

    In order to get any new technology out to the public there are certain procedures and documentations that a publisher must go through. I won’t be going over the entire process but instead I’ll be focusing on two areas which are Request for Comments (RFC) and an Internet Draft. Even the most popular networking technologies used today like IP and Ethernet had to go through these processes at some point. I’ll also be explaining the organizations that must produce the documentation and the processes to produce said documents.…

    • 634 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    I think that the organizations requirements for user's passwords to be several character long and have a certain amount of attempts is actually a great security measure. Yes, i think the additional security is worth it. I also think the number of security entry should be limited. The reason I agree with both is because if they were not in place it woud give people an easier chance of unlocking you phone and disappearing with it. For example, I have an Iphone i went to a friends get together. I place my phone down for 5 minute to get a drink someone took my phone and was trying to unlock it. The person could not get my code correct so my phone shut him out completely. I was happy because my information was protected.…

    • 413 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Typically the infant is found dead after having been put to bed, and exhibits no signs of having suffered.[7]…

    • 681 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Domestic Terrorism is defined by the FBI as: “The unlawful use, or threatened use, of force or violence by a group of individuals based and operated entirely within the United States or Puerto Rico without foreign direction committed against persons or property to intimidate or coerce a government, the civilian population, or any segment thereof in furtherance of political or social objectives.” ("Internal threats to," 2012)…

    • 508 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Improving a company’s system helps aid in its success in today’s market as well as in the future of the company’s growth and stabilization. this new system that will enable the company to promptly accomplish these requirements without hesitation and will not interfere with the company’s time management protocols or add extra unneeded expenses.…

    • 753 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    /* ------------------------------------------------------------------------- */ /* main program: input array element, set up a linked list type of binary */ /* tree and print the binary tree */…

    • 404 Words
    • 12 Pages
    Satisfactory Essays

Related Topics