write a java code to represent a sales class as follows: 1- The Sales class contains the...

60.1K

Verified Solution

Question

Programming

write a java code to represent a sales class asfollows:

1- The Sales class contains the names ofsellers (strings) and the sales/seller/day (matrix of integers).Assume the number of sellers is set dynamically by the constructorand that the sellers work 6 days/week.

Example:

names/days012345
Ali3058971909
Ahmad158151697825
Omar85967874154

The class should contain the following methods:

- setSaleDetails, this method takes two arguments: the array ofsellers' names and their detailed sales as a matrix ofintegers.

- printSalesDetails. This method prints the sellers' names andtheir sales (as in the example)

- printTotalSalesPerSeller. This method prints the list of totalsales for each seller during the week

- getBestSeller . This method prints the name of the seller whoachieved the highest sales during the whole week.

- getBestSellerAtDay . This method takes an integer Day as anargument (from 0 - 5). and prints the name of the seller whoachieved the highest sales at this specific day.

----- You are asked to implement a tester class calledSalesTester which has the main and do the following:

- creates an object from class Sales with a specific number ofsales (example: 3)

- generates a random set of sales for each seller. Assumesales/day is integer and between 0 and 100.

- set the names of sellers and their sales (pass it to createdobject)

- calls all the methods of the class Sales for testing.

Answer & Explanation Solved by verified expert
4.5 Ratings (867 Votes)
HiHope you are doing fine I have coded the above question in javaas per all the requirements mentioned above The code has beenclearly explained using comments that have been highlighted inbold Since the sample out of all the method has not    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students