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) 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...
-
A magnet of mass 5 . 0 1 kg is suspended from the ceiling by a cord as shown. A large magnet is somewhere off to the right, pulling on the small hanging magnet with a constant force of F = 8 0 . 4 N...
-
Do your answers to the preceding question depend on the angle at which the projectile is launched? Preceding Question A projectile falls beneath the straight-line path it would follow if there were...
-
Compute d/dx f(g (x)), where f(x) and g(x) are the following: f(x)=x, g(x) = x + 1
-
Northern Group, Inc., is a Wisconsin corporation that contracts with manufacturers and suppliers to develop marketing strategies and promotions to third-party retailers. In exchange for these...
-
What is the internal rate of return on the following projects, each of which requires a $20,000 cash outlay now and returns the cash flows indicated? a. $10,426.72 at the end of Years 1 and 2. b....
-
Pawan is pursuing MBA and shares a room with you in the private hostel. He desperately needs a job after completing his course because of educational loan and weak economic background. In his last...
-
What is one potential drawback of a strategic alliance in a health care environment? Oa. It causes confusion within both participating organizations. Ob. It can lead to the downfall of one of the...
-
Record the following FY 2021 Blue & Gold Company transactions in the General Journal. (Hint: See the Ledger worksheet for list of existing account names) Post the General Journal items to the General...
-
A rocket of mass 6 t is launched vertically. If the flow rate of the gas is 1 0 0 kg / s , determine the minimum velocity of the gas, to just lift the rocket off the launching pad. If the velocity is...
-
On January 1, Craig Company established a petty cash fund of $800. The following summary information was taken from petty cash vouchers for January: Postage Expense Office Supplies Entertainment...
-
1. How are you going to promote Ethical Communication? 2. Are you Pro or Anti Globalization? Why? 3. Direction: Write an explanation essay using one of the topics below. Follow the instruction below....
-
Discuss the concept of alignment in the supply chain process. When transporting a product, is the supply chain alignment different for different products such as soft drinks versus clothing? How does...
-
What is meant by normalization? Explain.
-
A seasonal index may be less than one, equal to one, or greater than one. Explain what each of these values would mean.
-
The following information is available for Mandalay Company: Required(a) Determine the material price variance based on the quantity of materials purchased.(b) Determine the material quantity...
-
1. According to the kaizen costing approach, who has the best knowledge to reduce costs? Why is this so? 2. Under what condition will the cost savings due to kaizen costing not be applied to...
-
Pitman Chemical Company manufactures and sells Goody, a product that sells for $10 per pound. The manufacturing process also yields 1 pound of a waste product, called Baddy, in the production of...
-
Given the following information, answer the questions about this project: a. Draw the network as a Gantt chart. b. What is the critical path? Which activities have slack time? c. What would happen if...
-
Develop a Gantt chart with the following information. What is the expected duration of the project? What is the critical path? Activity Expected Duration Predecessors A BL 12 8 None None C 5 None D...
-
Consider a project with the following information. Construct the project activity network using AOA methodology and label each node and arrow appropriately. Identify all dummy activities required to...
Study smarter with the SolutionInn App