Question: I have a some sample questions and I need a profesional person answer them in Linux- C program. I should be ready for exam. I
I have a some sample questions and I need a profesional person answer them in Linux- C program. I should be ready for exam. I will be appriciate.
here is the last one. I am sure the profesional people will answer these questions as always. Thank you
4) The cash register server and client use message queues. The cash register client will get two integers, the Product Code and the Quantity of that product. The cash register client will send a message to the server with the two integers. The server will return the amount to charge the customer (an integer). The client will print the charge to the customer.
a) Write the cash register server. Show the message queue initialization code. Assume I have provided a function int GetPrice(int pCode); that, given a product code will return the price of one of that item (i.e., quantity 1 price).
b) Write the cash register client. No loop, do only one product. There will be multiple cash register clients, so the client will need to have a critical section to ensure that no other cash register clients are accessing the server at the same time. Do not show the message queue initialization code, I will assume that it is the same as in the client. Do show the semaphore initialization code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
