Write a program that uses an object of type ServiceRequests to keep track of customers that have called. It should have a loop that, in each iteration, attempts to add a name, remove a name, or print all names. Use an array of size 10 as the list of names.
Suppose that you are in charge of customer service for a certain business. As phone calls come in, the name of the caller is recorded and eventually a service representative return the call and handles the request.
Write a class ServiceRequests that keeps track of the names of callers. The class should have the following methods:
• addName(name)—adds a name to the list of names. Throws a ServiceBackUpException if there is no free space in the list.
• removeName(name)—removes a name from the list. Throws a NoServiceRequestException if the name is not in the list.
• getName(i)—returns the ith name in the list.
• getNumber—returns the current number of service requests.
This project is fairly straightforward. ServiceRequests is really a queue. RemoveName is the only complicated methods in the class. An iterative approach that leaves it for last would be a good idea. The program is a basic while loop with multiple cases for each of the operations of the Service request class.
See the code in ServiceBackUpException.java, NoServiceRequestException.java, ServiceRequests.java, ServiceProgram.java.
You might also like to view...
What are the two main factors that affect how smooth the animation is in the Rebound program? Explain how changing either would affect it.
What will be an ideal response?
Given the following code snippet, what will be displayed on the web page?
``` var X = 23; var Y = 3; var Z = X + Y; document.write(Z); ``` a. 26 b. 233 c. NaN d. 23 3
To print a "Welcome" sign sideways, so that the paper is longer across the top, go to Modify Styles and select Landscape
Indicate whether the statement is true or false
NAP cannot work in conjunction with 802.1X.
Answer the following statement true (T) or false (F)