Question: assig



Share on Google+Share on Google+

jory adel ahmed
0 Answer(s)      5 years and 2 months ago
Posted in : Java Beginners

*A customer who wants to apply for getting a car license should provide information about the brand of the car. *Then the customer receives a request ID from the office. *The customer's request (represented by his/her ID) is sent to the specialized employee. *Each employee in the oce is specialized in only one brand. Thus, according to the brand of the car, the request is sent to one of the employees. *After receiving all the requests to be processed, the employee processes them and sorts them according to the request IDs, since the customer with smaller request ID will receive his license earlier than the one with higher request ID. *When a customer arrives to receive his/her license, s/he is directed to the specialized employee(according to the brand of the car being licensed). S/he is also assigned a turn to receive his/her license according to the assigned request IDs. To simulate the described process, you are required to implement the following: Class LicensingOffice which keeps track of the employees in an array data structure. It is initialized by passing the number of employees working in the office. Provide the class with the following methods: * void addEmployee(String brand) that inserts a new employee into the array, after specifying the car brand that he serves as input to the method. * int LicenseApplication(String brand) that assigns the customer a request ID and passes his request to the correct employee to be processed (depending on the car brand). The method will return -1 in case that the brand is not served at the office or the employee serving the brand cannot accept more licenses for the day. * void processDayRequests()that orders the employees to start processing the requests they have. * int[]recieveLicense(String brand,int reqID)that returns an array of two items. The first item is the number of the employee who serves the brand (his index in the array of employees). The second one is the turn of the customer request at the employee. The method returns null if the customer request is not found as a processed request.  Class Employee with attributes representing the car brand that this employee serves, the requests that s/he has received but has not been processed yet and the processed requests, sorted according to the request ID. Each employee has a maximum number of 50 requests that s/he can process per day. Provide the class with the following methods:  void newRequest(int requestID) which takes as input the ID of a request and adds this ID to the unprocessed requests of the employee.  void processRequests() which handles all the unprocessed requests, by moving them to the data structure holding the processed requests.  int getTurn(int requestID) which takes as input the request ID and returns the turn of the customer with this ID, given the fact that those with smaller request IDs are served first.  Class Customer with attributes representing the car brand, request ID, the ID of the employee who will serve him and his turn to be served by this employee. Note that not all the attributes are known by the customer. Some of them will be assigned by the licensing office whenever s/he applies for the license. Provide the class with the following methods:  void applyForLicense() that simulates the user application for a license. This method should set the value of the attribute representing the request ID.  void recievalTiming() that simulates the receiving process by setting the values of the attributes representing the ID of the employee who will serve the customer and the customer's turn. Note that all customers will head to the same licensing office.  A main method to test the class by simulating a minioofice with 3 employees and 7 customers. The three employees serves the brands Mercedes,Opel and Volks Wagen. The seven customers submits their application in the following order Mercedes owner, Volks Wagen owner, Mercedes owner, Opel owner, Volks Wagen owner, Opel owner, Mercedes owner. Your main method should print the attributes of each customer after the receiving his/her license. You are only allowed to use arrays in the class Office.

View Answers

Related Tutorials/Questions & Answers:
Java Spring Hibernate Struts Training What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017 Java brief history Best Reasons to learn Java Java Example Codes and Tutorials in 2017 How do I read a large file quickly in Java? Is learning Java worthwhile? How to create first Java Program? Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly?


Advertisement null