The store manager decided to giveaway Giants and Jets t-shirts to their customers since they were...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The store manager decided to giveaway "Giants" and "Jets" t-shirts to their customers since they were shutting down the business. People supporting their team had to carry a sign that says whether they are "Giants" fan of "Jets". Store manager has no other employee to help him out and had all the t-shirts piled up in one single pile. So he came up with his own rule. The rule is simple: If customer in a queue is carrying sign that says "Giant" AND t-shirt on the pile is "Giants" t-shirt (or if customer in a queue is carrying sign that says "Jets" AND t-shirt on the pile is "Jets" t-shirt) then customer takes the t-shirt and leave the queue otherwise customer joins back queue at the end of the line. This continues until none of the queue customer want to take the top t-shirt or there are no more t-shirts left. You need to design you program to find out how many customer will end up getting no t-shirts. Example Input and output: Input(two arrays of String): Output(integer) : 0 compare new state compare new state compare new state compare new state compare new state Step by step process for sample input/output: Operation t-shirt Customer (front,.....,end) J, G, J, G J, G, J, G J, G, J, G G, J, G G, J, G G, J, G G, J, G J, G J, G J, G } compare new state G compare G new state empty J, G customers = [G,G,J,J] Queue Lab (front,.....,end) G, J, J, G J, J, G, G J, J, G, G J, G, G J, G, G G, G, J G, G, J G, J G, J J, G J, G G G empty t-shirts [J,G,J,G] Explanation J!= G send customer back to queue J == J customer take the t-shirt and leaves queue G != J send customer back to queue G == G customer take the t-shirt and leaves queue J!= G send customer back to queue J == J customer take the t-shirt and leaves queue G == G customer take the t-shirt and leaves queue MyQueue.java import java.util.LinkedList; import java.util.Queue; public class MyQueue { public int count CustomerWithoutTshirt (String[] customer, String[] tshirt) { Queue q = new LinkedList (); // write your logic here Put all your work in ONE Zip file and submit it in Canvas. Zip filename should be in format of FirstLast_Lab5.zip (ex. John Doe_Lab5.zip) Zip file should contain 4 files only: (1) MyQueue.java (2) Demo.java (3) Output.docx (screenshot of input and output) (4) Pseudo-code.docx (provide pseudo-code) The store manager decided to giveaway "Giants" and "Jets" t-shirts to their customers since they were shutting down the business. People supporting their team had to carry a sign that says whether they are "Giants" fan of "Jets". Store manager has no other employee to help him out and had all the t-shirts piled up in one single pile. So he came up with his own rule. The rule is simple: If customer in a queue is carrying sign that says "Giant" AND t-shirt on the pile is "Giants" t-shirt (or if customer in a queue is carrying sign that says "Jets" AND t-shirt on the pile is "Jets" t-shirt) then customer takes the t-shirt and leave the queue otherwise customer joins back queue at the end of the line. This continues until none of the queue customer want to take the top t-shirt or there are no more t-shirts left. You need to design you program to find out how many customer will end up getting no t-shirts. Example Input and output: Input(two arrays of String): Output(integer) : 0 compare new state compare new state compare new state compare new state compare new state Step by step process for sample input/output: Operation t-shirt Customer (front,.....,end) J, G, J, G J, G, J, G J, G, J, G G, J, G G, J, G G, J, G G, J, G J, G J, G J, G } compare new state G compare G new state empty J, G customers = [G,G,J,J] Queue Lab (front,.....,end) G, J, J, G J, J, G, G J, J, G, G J, G, G J, G, G G, G, J G, G, J G, J G, J J, G J, G G G empty t-shirts [J,G,J,G] Explanation J!= G send customer back to queue J == J customer take the t-shirt and leaves queue G != J send customer back to queue G == G customer take the t-shirt and leaves queue J!= G send customer back to queue J == J customer take the t-shirt and leaves queue G == G customer take the t-shirt and leaves queue MyQueue.java import java.util.LinkedList; import java.util.Queue; public class MyQueue { public int count CustomerWithoutTshirt (String[] customer, String[] tshirt) { Queue q = new LinkedList (); // write your logic here Put all your work in ONE Zip file and submit it in Canvas. Zip filename should be in format of FirstLast_Lab5.zip (ex. John Doe_Lab5.zip) Zip file should contain 4 files only: (1) MyQueue.java (2) Demo.java (3) Output.docx (screenshot of input and output) (4) Pseudo-code.docx (provide pseudo-code) The store manager decided to giveaway "Giants" and "Jets" t-shirts to their customers since they were shutting down the business. People supporting their team had to carry a sign that says whether they are "Giants" fan of "Jets". Store manager has no other employee to help him out and had all the t-shirts piled up in one single pile. So he came up with his own rule. The rule is simple: If customer in a queue is carrying sign that says "Giant" AND t-shirt on the pile is "Giants" t-shirt (or if customer in a queue is carrying sign that says "Jets" AND t-shirt on the pile is "Jets" t-shirt) then customer takes the t-shirt and leave the queue otherwise customer joins back queue at the end of the line. This continues until none of the queue customer want to take the top t-shirt or there are no more t-shirts left. You need to design you program to find out how many customer will end up getting no t-shirts. Example Input and output: Input(two arrays of String): Output(integer) : 0 compare new state compare new state compare new state compare new state compare new state Step by step process for sample input/output: Operation t-shirt Customer (front,.....,end) J, G, J, G J, G, J, G J, G, J, G G, J, G G, J, G G, J, G G, J, G J, G J, G J, G } compare new state G compare G new state empty J, G customers = [G,G,J,J] Queue Lab (front,.....,end) G, J, J, G J, J, G, G J, J, G, G J, G, G J, G, G G, G, J G, G, J G, J G, J J, G J, G G G empty t-shirts [J,G,J,G] Explanation J!= G send customer back to queue J == J customer take the t-shirt and leaves queue G != J send customer back to queue G == G customer take the t-shirt and leaves queue J!= G send customer back to queue J == J customer take the t-shirt and leaves queue G == G customer take the t-shirt and leaves queue MyQueue.java import java.util.LinkedList; import java.util.Queue; public class MyQueue { public int count CustomerWithoutTshirt (String[] customer, String[] tshirt) { Queue q = new LinkedList (); // write your logic here Put all your work in ONE Zip file and submit it in Canvas. Zip filename should be in format of FirstLast_Lab5.zip (ex. John Doe_Lab5.zip) Zip file should contain 4 files only: (1) MyQueue.java (2) Demo.java (3) Output.docx (screenshot of input and output) (4) Pseudo-code.docx (provide pseudo-code)
Expert Answer:
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
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...
-
Find the median and the mode for the following data: 65, 66, 66, 70, 71, 72, 72, 72, 78, 83, 85, 86, 87, 87, 88, 88, 92, 93, 95, 95, 99, 100, 102, 102, 102, 102, 102, 103, 104, 108, 111, 113, 118,...
-
Sweet Stores, Inc., sells electronics and appliances. The excerpts that follow are adapted from Sweet Stores' financial statements for 2016 and 2015? Requirements 1. How much was Sweet Stores' cost...
-
Walmart wants to acquire more funding and will need a business case to do so. This business case will be featured in your financial plan that you will create next week. To get yourself prepared for...
-
How to prepare a witness for deposition?
-
Phil and Marcy have been married for a number of years. Marcy is very wealthy, but Phil is not. In fact, Phil, who has only $10,000 of property, is very ill, and his doctor believes that he probably...
-
Section B Answer all the questions in this section Question 21 (17 marks) The following information taken from Fremantle Consultancy Service Fremantle Consultancy Service Trial Balance (extract) as...
-
Using the data in the student spreadsheet file Ethan Allen Financials.xlsx (to find the student spreadsheets for Financial Analysis with Microsoft Excel, ninth edition, go to...
-
Discuss specifically (including examples) how the following concepts/techniques can be used in designing and delivering high-quality service by USPS (1) Based on Garvin's dimensions of...
-
How do social movements mobilize collective action and challenge dominant power structures to effect social change and promote social justice ?
-
Thalassines Kataskeves, S.A., of Greece makes marine equipment. The company has been experiencing losses on its bilge pump product line for several years. The most recent quarterly contribution...
-
What are the implications of postcolonial theory for understanding the legacies of colonialism and ongoing processes of decolonization in globalized societies ?
-
2. For the given structure and boundary conditions, find the allowable load Pallow given the material strengths are: Tf=210 MPa for pins C and D in shear; and of=400 MPa for bars BC and DE in...
-
Discuss an outline of your SWOT analysis identifying the organizational competencies and strategic advantages. strengths include a strong popularity in healthcare, a strong group of employees, strong...
-
1. Draw all the possible resonance structures for each ion. Use curved arrows to show movement of electrons. Identify the major resonance form in any and explain your reasoning (5 pts) NOTE: Hand...
-
Refer to the situation described inBE 18-13, but assume a 2-for-1 stock split instead of the 5% stock dividend. Prepare the journal entry to record the stock split if it is to be effected in the form...
-
Are materials always a flexible resource? Why?
-
What are some special considerations in the design of cost accounting systems for service organizations?
-
You are a senior manager responsible for overall company operations in a large courier company. Your company has 106 regional offices (terminals) scattered around the country and a main office (hub)...
-
The W14 \(\times 43\) simply supported beam is made of A-36 steel and is subjected to the loading shown. Determine the slope at \(A\) and \(B\). 2 kip/ft 10 ft C 10 ft B 40 kip-ft
-
Determine the slope at \(A\) and the displacement of at point \(C\) of the simply supported beam. The modulus of elasticity of the wood is \(E=10 \mathrm{GPa}\). A 3 kN 3 kN -1.5 m-1.5 m- 3 m. 100 mm...
-
The simply supported beam is made of A-36 steel and is subjected to the loading shown. Determine the displacement of its center \(C\). Take \(I=0.1457\left(10^{-3} ight) \mathrm{m}^{4}\). 20 kN 4...
Study smarter with the SolutionInn App