Calculate a running total of all cpu bursts

Assignment Help C/C++ Programming
Reference no: EM133119197

Question: Create a server process that accepts input from each of several clients. One at a time, a client sends a struct containing three values: a job name, a CPU burst (an integer), and a private FIFO name through a FIFO named Common_FIFO. The server calculates a running total of all CPU bursts it has received so far from the clients, and sends the current running total of CPU bursts back to the current client through its individual private FIFO. The server prints the name of the job, the value from the current client, and the current running total. After three clients have submitted their structs, the server calculates the average of all integers submitted by the clients.

A client prompts the user to enter an integer value between 1 and 16. If the integer is not in that range, continue to prompt the user for a valid integer. The current running total that is sent to the client from the server is also displayed on the client.

For example:
client 1 sends: Hmwk_6.c, 15, FIFO_4567 -> server calculates total as 15 and sends 15 to client 1
client 2 sends: OS_24, 9, FIFO_1238 -> server calculates total as 24 and sends 24 to client 2
client 3 sends: Prog_1.c, 8, FIFO_6789 -> server calculates total as 32 and sends 32 to client 3
... the server echoes all the values it receives from the clients
... the server prints "Average of 3 input values is 10.67 "
... to format this nicely, you can use: printf("%.2f", average);

Common_FIFO is created and opened once, and receives one struct input per client.

Prepare your own test data. For testing purposes, burst values will be those given in the example. Your program should allow one of the clients to input a value of 0, then 28 before it submits a valid integer in the range.

Attachment:- CPU burst.rar

Reference no: EM133119197

Questions Cloud

Describe target capital budgeting process : Describe Target's capital budgeting process and evaluate it. While doing so, discuss the role of the real-estate managers & CEC (Capital Expenditure Committee),
What are the average collection period : What are the Average Collection Period, Net Profit Margin, Total Asset Turnover, and Equity Multiplier for McDonalds and Wendys for FY2019 and FY2020?
Prepare an amortization schedule : The contract required payments of $200,000 a year over five years with the first payment due on December 31, 20x1. Prepare an amortization schedule
Estimate the cost of capital for utx corporation : You have been asked to estimate the cost of capital for UTX Corporation. The company has 7 million shares and 150,000 bonds outstanding at par value $10,000.
Calculate a running total of all cpu bursts : Create a server process that accepts input from each of several clients. One at a time, a client sends a struct containing three values: a job name
Calculate bank gogo earnings per share : PT Bank GoGo Tbk. has 50 million shares of stocks outstanding. In fiscal year 2020, Bank Gogo's after-tax profits reached IDR15 billion and the firm's stock is
Fitch downgrades waskita karya to ccc : Tue 06 Oct, 2020 - 5:55 AM ET Fitch Ratings - Jakarta - 06 Oct 2020: Fitch Ratings Indonesia has downgrade Indonesia-based contractor PT Waskita Karya (Persero)
Prepare a statement of owner equity for the year ended : On January 1, 20Y3, Xavier Heffner, Capital had a balance of $154,200. Prepare a statement of owner equity for the year ended
Dealing with a american call on currency : Suppose that you are dealing with a American call on currency, and that the foreign currency has risk-free rate 0. Explain why, in this case, the American call

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write cpp code to open a document with the name hello-txt

Write C++ code to open a document with the name Hello.txt, place the message "Hello, World!" in the document, and exit the document. Re open the file you closed, and read the message into a string variable.

  . write a segment of code that prints the number of elements

Assuming the array x has been defined as: int x[n]; for some n and that values have been assigned to all the elements. Write a segment of code that prints the number of elements between (but not including) the largest and smallest values in the array..

  Write a C program to solve the n-Queens problem

CS 262 Project. Your first project will be to write a C program to solve the n-Queens problem. You will write void randperm(int b[], int n) function

  Review of object oriented software development methodologies

Review of Object Oriented Software Development Methodologies

  Only letters are affected

You are to write a ROT13 (for "rotate 13") decoder to translate a secret message from its encoded state to something readable. In a ROT13 code, 'a' is shifted 13 letters to 'n', 'B' to 'O', 'c' to 'p', 'D' to 'Q', ..., 'N' to 'A', 'o' to 'b', 'P' ..

  C++ programming to add-subtract-multiply or divide two no

create a text-based, menu-driven program that allows the user to choose whether to add, subtract, multiply or divide two numbers. The program should then input two double values from the use, perform the appropriate calculation, and display the re..

  Display the current date and time in a human-readable format

The command "date" will display the current date and time in a human-readable format. Display the absolute pathname of the current working directory.

  Build a system using laravel - traveling website

Build a system using laravel - Traveling website - including properly formed relationships with primary keys and foreign keys

  Write a function printshampooinstructions with int parameter

Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, print "Too few."

  Effect on the monthly contribution margin

Although the Missouri Company has the capacity to produce 16,000 units per month, current plans call for monthly production and sales of only 10,000 units at $15 each. Costs per unit are as follows:

  Write a program which allows the user to perform simple task

Write a program which allows the user to perform simple tasks on a calculator. A series of functions allows the user to select an operation to perform and then enter operands.

  Write program that asks the user to enter a time duration

Write program that asks the user to enter a time duration in hours, minutes, and seconds and then displays the time in terms of hours in decimal format

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd