Question: CSC 326 Data Structures-Project 1- Implementation of Queue Based on Linked Nodes A company with fully automated car-washing machinery can wash a car in 1
CSC 326 Data Structures-Project 1- Implementation of Queue Based on Linked Nodes A company with fully automated car-washing machinery can wash a car in 1 to 10 minutes. The company would like to analyze the efficiency of its equipment: if it uses its fast setting, one car will be washed for 1 minutes but the quantity water and soap required at such speed will be high A slower settings use less soap and water but the washing time per car is higher The company wants to know haw many customers will have to wait in line when the washing equipment is set to one of the slower speeds. Car Wash Simulation - Specification Input. The program has three inputs: a) the total amount of the time needed to wash one car (in seconds), b) the probability that a new customer arrives during any given 3 seconds (we assume that at most one customer arrives in 3 seconds), c) the total length of time to be simulated (in seconds) Output. Our test program should produce at least the following outputs a) the number of customers serviced in the simulated time; b) the average time that a customer spent in line during the simulation (in seconds) The header file provides the class declarations of the three classes that you need: bool source, averager and washer and is given below. //File washing h / CLASSES PROVIDED: bool source, averager, washer /I CONSTRUCTOR for the bool source class: l bool_source(double p-0.5) II Precondition: 0 p-1. II Postcondition: The bool source has been initialized so that p is the / approximate probability of returning true in any subsequent activation ll of query). CONSTANT MEMBER FUNCTION for the bool source class Il bool query() const Postcondition: The return value is either true or false, with the Il probability of a true value being approximately p (from the constructor). /l CONSTRUCTOR for the averager class: ll averager) I Postcondition: The averager has been initialized so that it /I is ready to accept a sequence of numbers to average. //MODIFICATION MEMBER FUNCTION for the averager class: /l void next number(double value) ll Postcondition: The averager has accepted value as the next /l number in the sequence of numbers which it is averaging /CONSTANT MEMBER FUNCTIONS for the averager class: // size t how many numbers() const Postcondition: The value returned is a count of how many times next number has been activated
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
