the class file — public class SalesData { private double[] sales;…
Question Answered step-by-step the class file — public class SalesData { private double[] sales;… the class file — public class SalesData{ private double[] sales; public SalesData(double[] s) { sales = new double[s.length]; for (int index = 0; index < s.length; index++) sales[index] = s[index]; } public double getTotal() { double total = 0.0; for (int index = 0; index < sales.length; index++) total += sales[index]; return total; } public double getAverage() { return getTotal() / sales.length; } public double getHighest() { double highest = sales[0]; for (int index = 1; index < sales.length; index++) { if (sales[index] > highest) highest = sales[index]; } return highest; } public double getLowest() { double lowest = sales[0]; for (int index = 1; index < sales.length; index++) { if (sales[index] < lowest) lowest = sales[index]; } return lowest; }}question, creat e a program to demonstrate the use of the class. The program should begin with a passcode validation that will only allow the user to access the program if a passcode with at least 2 uppercase letters and at least 2 lowercase letters is entered. If an inaccurate passcode is entered, the program should loop and prompt the user again until a proper code is entered. (25 Points) 5. Given the SalesData class file, complete the demo program for weekly sales that accepts sales figures for 5 days from the user into an array. Then, creat e an instance of the class and pass the array. Finally, return figures for output that should create an output similar to this: (75 Points)using this class file, output should be likeEnter a Password:mei,ejThe password did not meet the requirements of at least 2 uppercase letters and at least 3 lowercase lettersPlease reenter the password:Enter a Password:uhduIWEIIEnter the sales for day 1100Enter the sales for day 2200Enter the sales for day 3300Enter the sales for day 4400Enter the sales for day 5500The total sales were $1,500.00The average sales were $300.00The highest sales were $500.00The lowest sales were $100.00 Computer Science Engineering & Technology Java Programming CS 160 Share QuestionEmailCopy link Comments (0)


