public string CashierGenerated Number(string CashierNumber) { x++; CashierNumber = Cashier Number + x.ToString(); return Cashier Number;

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 9PP
icon
Related questions
Question

C# language

SEE PICTURE FOR INSTRUCTIONS

Table 1. Forms and Controls
Controls/Forms
Button
Label
Form
btnCashier
IblQueue
QueuingForm
Name
Create a class named CashierClass and add the following codes:
private int x;
public static string getNumberInQueue = "";
public static Queue <string> CashierQueue;
Table 1. Forms and Controls
*Note: The other label is not required to set the names, only the controls/forms that is needed.
public CashierClass() {
x = 10000;
CashierQueue = new Queue<string>();
Cashier
}
public string CashierGenerated Number (string CashierNumber) {
X++;
CashierNumber = Cashier Number + x.ToString();
return Cashier Number;
Cashier
P-10007
Position in Queue
P-10007
}
In the first form named QueuingForm, double click the button to create an event named Click.
Call CashierClass and declare its variable named cashier. Set the access modifier for the declared
class to private.
Ex. private int x;
After the declaration of the variable for CashierClass, initialize the variable cashier inside the
constructor of QueuingForm.
After declaring and initializing the code, add the following codes inside the created event of the button
named btnCashier.
lblQueue.Text = cashier. Cashier Generated Number ("P - ");
Cashier Class.get Number InQueue = lblQueue.Text;
Cashier Class.CashierQueue. Enqueue (CashierClass.getNumber InQueue);
In the second form named CashierWindowQueue Form, add two (2) buttons and a List View control.
See Table 2 for the names of each control.
Transcribed Image Text:Table 1. Forms and Controls Controls/Forms Button Label Form btnCashier IblQueue QueuingForm Name Create a class named CashierClass and add the following codes: private int x; public static string getNumberInQueue = ""; public static Queue <string> CashierQueue; Table 1. Forms and Controls *Note: The other label is not required to set the names, only the controls/forms that is needed. public CashierClass() { x = 10000; CashierQueue = new Queue<string>(); Cashier } public string CashierGenerated Number (string CashierNumber) { X++; CashierNumber = Cashier Number + x.ToString(); return Cashier Number; Cashier P-10007 Position in Queue P-10007 } In the first form named QueuingForm, double click the button to create an event named Click. Call CashierClass and declare its variable named cashier. Set the access modifier for the declared class to private. Ex. private int x; After the declaration of the variable for CashierClass, initialize the variable cashier inside the constructor of QueuingForm. After declaring and initializing the code, add the following codes inside the created event of the button named btnCashier. lblQueue.Text = cashier. Cashier Generated Number ("P - "); Cashier Class.get Number InQueue = lblQueue.Text; Cashier Class.CashierQueue. Enqueue (CashierClass.getNumber InQueue); In the second form named CashierWindowQueue Form, add two (2) buttons and a List View control. See Table 2 for the names of each control.
Create a queuing program that automatically generates a number once the student clicks the button to
This program should have two (2) window forms named QueuingForm and
Queue Form. See Figures 1 and 2.
get a number.
CashierWindow
QueuingForm
Cashier
*Click to get a number
Position in Queue
P - 10007
Figure 1. Queuing Form
CashierWindowQueueForm
Refresh
Next
P - 10001
P - 10002
P - 10003
P-10004
P - 10005
P-10006
P - 10007
Figure 2. CashierWindowQueueForm
Follow the given design in Figure 1. See Table 1 for the names of the control that contains function.
Transcribed Image Text:Create a queuing program that automatically generates a number once the student clicks the button to This program should have two (2) window forms named QueuingForm and Queue Form. See Figures 1 and 2. get a number. CashierWindow QueuingForm Cashier *Click to get a number Position in Queue P - 10007 Figure 1. Queuing Form CashierWindowQueueForm Refresh Next P - 10001 P - 10002 P - 10003 P-10004 P - 10005 P-10006 P - 10007 Figure 2. CashierWindowQueueForm Follow the given design in Figure 1. See Table 1 for the names of the control that contains function.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr