Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I just wanna ( class Customer & public boolean enqueue(String n, int items)& public int queueSize(String name) & public Customer MinItems() & public double average()

image text in transcribedimage text in transcribedimage text in transcribed

I just wanna ( class Customer & public boolean enqueue(String n, int items)& public int queueSize(String name) & public Customer MinItems() & public double average() & public class ExamTest )

Please quickly in Java

1) class Customer that includes the following data members: private String name; //Customer name private int orderID; l/order id private int totalItems; //total Items private Customer next; The class should have the following: A constructor that initializes the instance variables name, totalItems and orderID. Set and get methods for each instance variable. 2) class Waiting Line that includes the following instance variables: private Customer head, tail private String shopName; private int numOfOrder; The class should have the following methods: A constructor that initializes the market name shopName and sets numOfOrder to 0. . public boolean enqueue(String name, int items) Modify the given enqueue method to increment numOfOrder by 1, creates a Customer using numOfOrder as the orderID and adds a Customer in the queue. public void print() The method is given in the attached file. Do not make any changes to the method. private void enqueue() The method is given in the attached file. Do not make any changes to the method. public Customer dequeue() The method is given in the attached file. Do not make any changes to the method. public int queueSize(String name) Counts how many customers are in front of the customer with that name. Returns the count. public Customer MinItems() Returns the Customer with the minimum total items. public double average() Calculates the average of the total items in the queue and returns its value. 3) Write a test application named ExamTest. In the main method, display a menu of options as shown in the sample output: Class Waitingline Choice 1: Ask the user to enter the customer information and call method enqueue. If the method returns false, display an error message Error adding customer. Choice 2: Call method print Choice 3: Ask the user to enter the customer name and call method queueSize and print the result. Choice 4: Call method MinItems and print the result. Choice 5: Call method average and print the result Choice 6: Exit the program. Criteria Max Mark Class Customer 10.00 Sample Output Instant variables 3.00 constructor 2.00 Choose: Update method 1. Add a Customer enqueue 10.00 2. Print all Customers 3. Find queue size queue Size method 10.00 4. minimum items minltems method 10.00 5. Find average Average method 10.00 6. Exit Class Exam Test 25.00 1 5.00 Enter the customer name: Fatma Syntax Errors Enter the total items: 5 Output 5.00 Choose: Total 100.00 1. Add a Customer 2. Print all Customers 3. Find queue size 4. minimum items 5. Find average 6. Exit 1 Enter the customer name: Ali Enter the total items: 10 Choose: 1. Add a Custom 2. Print all Customers 3. Find queue size 4. minimum items 5. Find average 6. Exit 1 Enter the customer name: Sara

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions