Sunayana Maity

Sunayana Maity

  • NA
  • 2
  • 1.4k

C# --- Generics

Jun 10 2022 4:50 AM

Create a console application to manage a queue of customer service requests in banking domain. The application has to create a service token and manage it. The application must have a class, "ServiceToken" with the auto implemented properties: TokenID as integer (auto generated), Position, TicketDateTime as DateTime, Status as string. This class must have a instance constructor to assign the values to these properties.

The application should define another class, TicketManager, with Queue as an auto implemented property. In this class define the below methods with the mentioned behavor.

1. GenerateServiceToken(): This method should create an instance of ServiceToken class and add to the List.

2. GetNextToken(): This method should get the next available token from the Queue.

3. UpdateToken(int TokenID): This method should update the corresponding token's

status to complete.

4. SkipToken(): This method should skip the immediate next token and return the subsequent token.

Write a driver code to display the UI as below and call the respective operations when

an option is selected.

TOKEN MANAGEMENT SYSTEM

1. Create Token

2. Get Next Token

3. Update Token

4. Skip Token

5. List all tokens

6. Exit

Enter your Choice?

If option 1 is selected, call GenerateServiecToken() method,

If option 2 is selected, call GetNextToken(),

If option 3 is selected, call the UpdateToken(int TokenID) by passing the current token ID

If option 4 is selected, call SkipToken(),

If option 5 is selected, display all the tokens information, If option 6 is selected, exit the application


Answers (1)