The formula for finding the approximate waiting time for a person in position of a queue at the bank is where · is the waiting time for client #, · is the waiting time for the previous client (i.e....


The formula for finding the approximate waiting time for a person in position of a queue at the bank is



where


· is the waiting time for client #,


· is the waiting time for the previous client (i.e. client #),


· is the number of people ahead of you in a queue,


· is the average time it takes to serve a single client (this will be entered by the user once), and


· is Euler’s number with a fixed value of 2.71828.



Write a program
that finds and displays the average waiting time for 12 clients in a queue that includes the following:


(a)The definition of as a fixed value.


(b)The definition of appropriate variables as required.


(c)User input for the average time it takes to serve a single client (i.e.) in that particular bank.


(d)A functionfind()
that, for each client, finds their waiting time and stores the result in an array calledtime. (hint: your function must make use of a looping structure, that keeps record of previous person’s waiting time.)


(e)A functionaver()
that finds the average of the values in time, and returns the result.


(f)Amain()
function that


(i)calls the above functions in the right order and appropriately.


displays the average waiting time for the 12 clients



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here