A Eclipse - Changing the Color Theme - YouTube moodle.cs.usask.ca Chegg Study Guided Solutions and Study...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A Eclipse - Changing the Color Theme - YouTube moodle.cs.usask.ca Chegg Study Guided Solutions and Study Help | Chegg.com Queue Analysis of the Tim Horton's Lineup for Coffee As mentioned in class, there are usually two ways in which customers are lined up for access to a number of service windows. Typically in a bank, there is one queue line for everyone and a number of windows. When a window becomes free, the next person at the head of the queue leaves the queue and proceeds to the window. People coming into the bank simply join the single queue at the tail of the queue. At Tim's in Geology, we have the other approach to providing service. Every service window has its own queue. Typically when a person comes up to the lines, they choose the shortest line to join and then stay in that line. It can frustrate some people to see the longer line actually move faster and sometimes people will line hop (i.e. when the other line is shorter than the queue in front of me). https://moodle.cs.usask.ca/pluginfile.php/44297/mod_resource/cont... So which is the best approach? In this assignment we are going to try and determine that. Here are the parameters for the simulation. For both simulations you are to do the following: Run the simulation for 6 hours A new customer group arrives every 1 minute 58 seconds (i.e. as little as 2 seconds apart and as much as 1 min 50 seconds apart A group will consist of 1 to 6 customers following this distribution: O 1 person - 30% O O 2 people -40% O 3 people -20% O 4 people - 5% O 5 people - 3% 6 people -2% Each person in the group joins the queue single file but we can use the same join time for each member of the group. 1. A method called printArray that takes an array of integer values and a boolean value. The method prints the array elements on the same line with one space between each two elements. If the boolean value is true, the elements must be printed in their original order, if it is false they must be printed in reverse order. The method should print a new line after printing the array elements. (1 point) 2. A method called getStatistics that takes an array of integers and an integer, and returns a double value based on the value of the integer parameter as follows: (2 points) If the value of the integer parameter is 1, it returns the summation of the array elements. If the value of the integer parameter is 2, it returns the average of the array elements. If the value of the integer parameter is 3, it returns the maximum value in the array. If the value of the integer parameter is 4, it returns the minimum value in the array. If the value of the integer parameter is 5, it returns the variance of the array elements whose equation is as follows: (x; x)2 - n-1 x is the average, and n is the number of elements in the array. If the value of the integer parameter is none of the above, the method must print the statement "Invalid Choice - ZERO returned" and returns 0. 3. A method called isAscending Ordered that takes an array of integers and returns true if it's ordered ascendingly and false otherwise. (1 point) 4. A method called shiftAndFill that takes an array of integers and a variable length argument list of integers. The method must shift the array elements to the right and fill the emptied indices with the values in the variable length argument. (1 point) Note that this method must not create a new array, it must modify the array in its place. Moreover, it must make sure the number of values in the variable length argument is less that the array length. If not, the array must not be modified. Similarly, if there are no values passed in the variable length argument, the array must not be modified. For example, if the passed array is 6, 2, 5, 1, 8, and the values 10, 9 are passed in the variable length argument, after invoking the method the array must become: 10, 9, 6, 2, 5 A Eclipse - Changing the Color Theme - YouTube moodle.cs.usask.ca Chegg Study Guided Solutions and Study Help | Chegg.com Queue Analysis of the Tim Horton's Lineup for Coffee As mentioned in class, there are usually two ways in which customers are lined up for access to a number of service windows. Typically in a bank, there is one queue line for everyone and a number of windows. When a window becomes free, the next person at the head of the queue leaves the queue and proceeds to the window. People coming into the bank simply join the single queue at the tail of the queue. At Tim's in Geology, we have the other approach to providing service. Every service window has its own queue. Typically when a person comes up to the lines, they choose the shortest line to join and then stay in that line. It can frustrate some people to see the longer line actually move faster and sometimes people will line hop (i.e. when the other line is shorter than the queue in front of me). https://moodle.cs.usask.ca/pluginfile.php/44297/mod_resource/cont... So which is the best approach? In this assignment we are going to try and determine that. Here are the parameters for the simulation. For both simulations you are to do the following: Run the simulation for 6 hours A new customer group arrives every 1 minute 58 seconds (i.e. as little as 2 seconds apart and as much as 1 min 50 seconds apart A group will consist of 1 to 6 customers following this distribution: O 1 person - 30% O O 2 people -40% O 3 people -20% O 4 people - 5% O 5 people - 3% 6 people -2% Each person in the group joins the queue single file but we can use the same join time for each member of the group. 1. A method called printArray that takes an array of integer values and a boolean value. The method prints the array elements on the same line with one space between each two elements. If the boolean value is true, the elements must be printed in their original order, if it is false they must be printed in reverse order. The method should print a new line after printing the array elements. (1 point) 2. A method called getStatistics that takes an array of integers and an integer, and returns a double value based on the value of the integer parameter as follows: (2 points) If the value of the integer parameter is 1, it returns the summation of the array elements. If the value of the integer parameter is 2, it returns the average of the array elements. If the value of the integer parameter is 3, it returns the maximum value in the array. If the value of the integer parameter is 4, it returns the minimum value in the array. If the value of the integer parameter is 5, it returns the variance of the array elements whose equation is as follows: (x; x)2 - n-1 x is the average, and n is the number of elements in the array. If the value of the integer parameter is none of the above, the method must print the statement "Invalid Choice - ZERO returned" and returns 0. 3. A method called isAscending Ordered that takes an array of integers and returns true if it's ordered ascendingly and false otherwise. (1 point) 4. A method called shiftAndFill that takes an array of integers and a variable length argument list of integers. The method must shift the array elements to the right and fill the emptied indices with the values in the variable length argument. (1 point) Note that this method must not create a new array, it must modify the array in its place. Moreover, it must make sure the number of values in the variable length argument is less that the array length. If not, the array must not be modified. Similarly, if there are no values passed in the variable length argument, the array must not be modified. For example, if the passed array is 6, 2, 5, 1, 8, and the values 10, 9 are passed in the variable length argument, after invoking the method the array must become: 10, 9, 6, 2, 5
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Read and answer the question below. EMBRACE DEMOGRAPHICS AND SOCIETAL CHANGES Using Differences to Drive Value Force 7: Demographics and Societal Changes. One of the most important forces that is...
-
Maria is opposed to the idea of same-sex marriage. In a recent conversation in the school cafeteria, Maria argues, "If homosexuals are allowed to marry, then why not allow polygamy or other kinds of...
-
How do the beliefs of the McCoy family form the culture of this company?
-
A car manufacturer states that the engine displacement for a certain model is 2400cm 3 . What should be the least possible and greatest possible displacements?
-
Teddys daily budget constraint is shown in the following chart. Teddys employer pays him a base wage rate plus overtime if he works more than the standard hours. What is Teddys daily nonlabor income?...
-
Plum Corporation began the month of May with $ 700,000 of current assets, a current ratio of 2.50:1, and an acid-test ratio of 1.10:1. During the month, it completed the following transactions (the...
-
Corporate taxation in South Africa is too high and has negative implications for economic growth and our competitiveness with our main trading partners." Do you agree with this statement? Why (not)?...
-
Hasan Fareed, a 24-year-old college graduate, never took a personal finance class. He pays his bills on time, has managed to save a little in an investment account, and with the help of an...
-
A company has five-year new product (Electric motorcycle) project will cost $50,000 to implement the project. It has a projected cash inflow of $15,000, $15,000, $20,000, $20,000, and $20,000 in the...
-
Monochromatic light having a wavelength of 633 nm from a HeliumNeon laser is incident on two thin slits spaced .050 mm apart. There is a viewing screen placed 2.0 m from the slits. You observe a...
-
Explain the Newtonian limit of general relativity.
-
A square-shaped length L of brass wire is 195.50 cm long and each edge measures d = 2.50 x 10^-4 m. The resistivity of this yellow alloy of copper and zinc is 7.50 x 10^-8 ohm*meters. The battery is...
-
A company's inventory records report the following in November of the current year: Beginning November 1 5 units @ $20 Purchase November 2 10 units @ $22 Purchase November 12 6 units @ $25 On...
-
You are asked to design spring bumpers for the walls of a parking garage. A freely rolling 1300 kg car moving at 0.650 m/s is to compress the spring no more than 7.00 cm before stopping. A. What...
-
a).Explain role of teacher in curriculum development process at various level? b). Distinguish between Aims, goals and objectives?
-
AB CORPORATION ISSUED THE FOLLOWING 850 COMMON STOCKS PAR VALUE P100 750 PARTICIPATING PREFERRED STOCKS PAR VALUE P100 AT 3% AB CORPORATION DECLARED P100,000.00 DIVIDEND IN 2022.
-
In a flexible exchange rate system, explain why a country whose income grows faster than that of its trading partners can expect its exchange rate to fall, or the value of its currency to depreciate.
-
Give illustrations from the opening case in this chapter of how both microeconomic and macroeconomic factors influence the global automobile industry.
-
The following table shows data for a simple production function. a. From the information in the table, calculate total and average products. b. Graph the three functions (put total product on one...
-
For the particular case of hard spheres, the pressure in the virial equation of state is determined by evaluating the pair correlation function at contact. Write the pair correlation function as...
-
Use a virial expansion approach to determine the first few nontrivial order contributions to the pair correlation function \(g(r)\) in \(d\) dimensions. Show that the pair correlation function is of...
-
(a) For a dilute gas, the pair correlation function \(g(r)\) may be approximated as \[g(r) \simeq \exp \{-u(r) / k T\}\] Show that, under this approximation, the virial equation of state (10.7.11)...
Study smarter with the SolutionInn App