Basic Queuing Cashier Objectives: T Use simple and generic collection in a program; Manipulate a program using generic collection methods; and Create a hashtable, list, stack, and queue. Software Requirement: • One (1) personal computer with pre-installed Windows Operating System Visual Studio IDE 2015 or higher Procedures: Instructions: 1. Create a queuing program that automatically generates a number once the student clicks the button to get a number. This program should have two (2) window forms named QueuingForm and CashierWindowQueueForm. See Figures 1 and 2. Cashier *Click to get a number Position in Queue P-10007 Figure 1. QueuingForm Refresh P-10001 P-10002 Next P-10003 P-10004 P-10005 P-10006 P-10007 Figure 2. CashierWindowQueueForm 2. Follow the given design in Figure 1. See Table 1 for the names of the control that contains function. Controls/Forms Button Label Form btnCashier IblQueue QueuingForm Name x++; 3. Create a class named CashierClass and add the following codes: private int x; public static string getNumberInQueue = ""; public static Queue 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 (); Cashier } public string CashierGeneratedNumber(string CashierNumber){ 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 4 5. Call CashierClass and declare its variable named cashier. Set the access modifier for the declared class to private. Ex. private int x; 6. After the declaration of the variable for CashierClass, initialize the variable cashier inside the constructor of QueuingForm. 7. 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- "); CashierClass.get Number InQueue = lblQueue.Text; Cashier Class.CashierQueue.Enqueue (CashierClass.getNumber InQueue); 8. 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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Show how it is done and explain

Basic Queuing Cashier
Objectives:
• Use simple and generic collection in a program;
▪ Manipulate a program using generic collection methods; and
. Create a hashtable, list, stack, and queue.
Software Requirement:
•
One (1) personal computer with pre-installed Windows Operating System
• Visual Studio IDE 2015 or higher
Procedures:
Instructions:
1. Create a queuing program that automatically generates a number once the student clicks the button to
get a number. This program should have two (2) window forms named Queuing Form and
CashierWindowQueueForm. See Figures 1 and 2.
Queuingform
Cashier
*Click to get a number
Position in Queue
P-10007
Figure 1. QueuingForm
Refresh P-10001
Next
P-10002
P-10003
P-10004
P-10005
P-10006
P-10007
Figure 2. CashierWindowQueueForm
2. Follow the given design in Figure 1. See Table 1 for the names of the control that contains function.
Table 1. Forms and Controls
Controls/Forms
Button
Label
Form
btnCashier
IblQueue
QueuingForm
Name
3. 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
}
4.
In the first form named QueuingForm, double click the button to create an event named Click.
5.
Call CashierClass and declare its variable named cashier. Set the access modifier for the declared
class to private.
Ex. private int x;
6. After the declaration of the variable for CashierClass, initialize the variable cashier inside the
constructor of QueuingForm.
7. 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- ");
CashierClass.get Number InQueue = lblQueue.Text;
CashierClass.CashierQueue.Enqueue (CashierClass.getNumberInQueue);
8. In the second form named CashierWindow Queue Form, add two (2) buttons and a List View control.
See Table 2 for the names of each control.
Transcribed Image Text:Basic Queuing Cashier Objectives: • Use simple and generic collection in a program; ▪ Manipulate a program using generic collection methods; and . Create a hashtable, list, stack, and queue. Software Requirement: • One (1) personal computer with pre-installed Windows Operating System • Visual Studio IDE 2015 or higher Procedures: Instructions: 1. Create a queuing program that automatically generates a number once the student clicks the button to get a number. This program should have two (2) window forms named Queuing Form and CashierWindowQueueForm. See Figures 1 and 2. Queuingform Cashier *Click to get a number Position in Queue P-10007 Figure 1. QueuingForm Refresh P-10001 Next P-10002 P-10003 P-10004 P-10005 P-10006 P-10007 Figure 2. CashierWindowQueueForm 2. Follow the given design in Figure 1. See Table 1 for the names of the control that contains function. Table 1. Forms and Controls Controls/Forms Button Label Form btnCashier IblQueue QueuingForm Name 3. 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 } 4. In the first form named QueuingForm, double click the button to create an event named Click. 5. Call CashierClass and declare its variable named cashier. Set the access modifier for the declared class to private. Ex. private int x; 6. After the declaration of the variable for CashierClass, initialize the variable cashier inside the constructor of QueuingForm. 7. 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- "); CashierClass.get Number InQueue = lblQueue.Text; CashierClass.CashierQueue.Enqueue (CashierClass.getNumberInQueue); 8. In the second form named CashierWindow Queue Form, add two (2) buttons and a List View control. See Table 2 for the names of each control.
Controls/Forms
Button
ListView
Form
btnRefresh
btnNext
}
Name
listCashierQueue
CashierWindowQueue
Table 2. CashierWindowQueue Form controls
Refresh
Next
P-10001
P-10002
P-10003
P-10004
P-10005
P-10006
P-10007
Refresh P-10001
P-10002
Next
P-10003
P-10004
P-10005
P-10006
P-10007
9. Double click the button named btnRefresh to call the event click method and add the code below.
Display CashierQueue (CashierClass.Cashier Queue);
public void Display CashierQueue (IEnumerable CashierList){
list CashierQueue.Items.Clear();
foreach(Object obj in CashierList) {
list CashierQueue.Items.Add(obj.ToString());
10. You will notice that the code inside btnRefresh_Click has an error. To remove the error, add the
method below.
}
"Note: This method is used to display the output on the List View. You can still modify this code for different controls.
Challenge
11. The given code will only add the number in queue and manually refresh the list for new students.
12. For this challenge exercise, write a program that will remove the number that is already done.
13. Make this program automatically refresh the list when there are updates in the queue.
*Note: Use the Timer control for this. See the sample code below for the timer class.
Timer timer new Timer();
timer.Interval (11000) // 1 sec.
timer.Tick += new EventHandler(tiner1_tick); //timer1_tick represents the name of Tick Event
timer.Start();
14. Run the program to check the output.
Transcribed Image Text:Controls/Forms Button ListView Form btnRefresh btnNext } Name listCashierQueue CashierWindowQueue Table 2. CashierWindowQueue Form controls Refresh Next P-10001 P-10002 P-10003 P-10004 P-10005 P-10006 P-10007 Refresh P-10001 P-10002 Next P-10003 P-10004 P-10005 P-10006 P-10007 9. Double click the button named btnRefresh to call the event click method and add the code below. Display CashierQueue (CashierClass.Cashier Queue); public void Display CashierQueue (IEnumerable CashierList){ list CashierQueue.Items.Clear(); foreach(Object obj in CashierList) { list CashierQueue.Items.Add(obj.ToString()); 10. You will notice that the code inside btnRefresh_Click has an error. To remove the error, add the method below. } "Note: This method is used to display the output on the List View. You can still modify this code for different controls. Challenge 11. The given code will only add the number in queue and manually refresh the list for new students. 12. For this challenge exercise, write a program that will remove the number that is already done. 13. Make this program automatically refresh the list when there are updates in the queue. *Note: Use the Timer control for this. See the sample code below for the timer class. Timer timer new Timer(); timer.Interval (11000) // 1 sec. timer.Tick += new EventHandler(tiner1_tick); //timer1_tick represents the name of Tick Event timer.Start(); 14. Run the program to check the output.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 9 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY