Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone help me with the code on this? Submission and Grading: The file cont

ID: 3754057 • Letter: C

Question

Can someone help me with the code on this?

Submission and Grading:

The file containing main must be named Main.java. (-5 points)

The project files must be in a package named DrinkRewards. (-5 points)

All project deliverables are to be submitted in eLearning.

Zip the contents of the src directory into a single zipped file

o Make sure the zipped file has a .zip extension (not .tar, .rar, .7z, etc.) (-5 points)

o Please review the submission testing information in eLearning on the Course Homepage

Projects submitted after the due date are subject to the late penalties described in the syllabus.

Programs must compile and run with JDK 8.

Each submitted program will be graded with the rubric provided in eLearning as well as a set of test cases.

These test cases will be posted in eLearning after the due date. Each student is responsible for developing

sample test cases to ensure the program works as expected.

Type your name and netID in the comments at the top of all files submitted. (-5 points)Objectives:

Use inheritance to create base and child classes.

Utilize multiple classes in the same program.

Perform standard input validation

Implement a solution that uses polymorphism

Problem: Disneyland has begun a service that allows guests at the park to pre-order drinks and pick them up at a designated time so as to avoid long concession lines. Guests that spend more than $50 (cumulatively) become preferred customers and are awarded discounts on their orders. A program is needed to track the amount spent by each customer and promote them to preferred customer when they have accumulated $50 in purchases.

Pseudocode: Your pseudocode should describe the following items

Main.java

o List functions you plan to create

Determine the parameters
Determine the return type
Detail the step-by-step logic that the function will perform

o Detail the step-by-step logic of the main function

Classes:

Details:

Customer (base class)o Members

First name (string)
Last name (string)
Guest ID (string)
Amount spent (float)

o Methods
Overloaded Constructor

Accessors

Mutators

Preferred Customer - Gold (derived from customer)

o Member
Discount Percentage (float)

o Methods
Overloaded Constructor (chained to base class constructor) Accessor
Mutator

Preferred Customer - Platinum (derived from customer)o Member

Bonus bucks (float)o Methods

Overloaded Constructor (chained to base class constructor) Accessor
Mutator

The price of the drink is determined by the type of drink and the amount of ounces orderedo Soda - $0.20

o Tea - $0.12

o Fruit punch - $0.15
Each drink will come in a cylindrical container

o Small
Diameter – 4 in.

Height – 4.5 in.

12 oz.o Medium

Diameter – 4.5 in. Height – 5.75 in. 20 oz.

o Large
Diameter – 5.5 in.

Height – 7 in.

32 oz.
The container can be personalized with different Disney graphics

o The total price of the personalization is determined by the price per square inch
o The area covered by the graphic will be just the outer surface area of the cylindero The surface area of the cylinder will not include the top and bottom of the cylinder

Preferred customer information and regular customer information will be stored in files and will be read into memory before the program processes orders.

o The preferred customer file may be empty or may not exist.
o In both cases, the respective customer array should not be created until a customer reaches

preferred status.

Regular customers and preferred customers will be held in 2 separate arrays. (-10 points if not)o Both gold and platinum customers will be stored in the same array (preferred)
o Do not use an array list for this project

The arrays will never be larger than the actual number of customers in each category.

Orders will be read from a file.

After processing an order, if a regular customer has spent at least $50, promote the customer to

preferred status (gold).

o The preferred customer array will be resized to add one more element.
o Add the new preferred customer into the open element at the end of the preferred customer

array.
o Resize the regular customer array and remove the customer data that was promoted to preferred

status.
o Do not rearrange the order of the data in either array.
o Remember that each array should be no bigger than the number of customers at that level.

Gold preferred customers get a discount based on how much they have spent overallo $50 = 5% discount

o $100 = 10% discount
o $150 = 15% discount
o This discount applies as soon as the above target value is obtained.

Example 1: customer has spent $40 previously. The customer places an order for drinks that amounts to $10. The customer is immediately placed in preferred status and given a 5% discount. The new amount spent is $49.50

Example 2: customer has spent $90 previously. The customer places an order for drinks that amounts to $10. However, the customer has a 5% discount as a preferred customer. The customer has a total of $99.50 after the discount is applied and is not moved to the next bracket for preferred customers

If the customer placed an order for $11, the new total with the discount would be $100.45. The customer is immediately placed into the new bracket and a 10% discount is given instead. The new amount would be $99.90 and the customer would be at the 10% discount level.

After processing an order, if a gold preferred customer has spent at least $200, promote the customer to platinum status.

o Replace the gold member object in the array with a platinum member objecto Update the bonus bucks if necessary (see below)

Platinum preferred customers receive bonus bucks instead of a discount.
o For every $5 over $200, the customer receives 1 bonus buck (worth a dollar)

When an order is placed, bonus bucks are only earned for every multiple of $5 above the beginning total

For example, if a customer has spent $217, and makes a purchase of $12, the customer would earn 2 bonus bucks (one for $220 and one for $225)

o The bonus buck is applied to the next order
o The total spent does not include any bonus bucks used

If an order costs $5 and a bonus buck is used, the total sales increases by $4.
o Platinum status is applied when the total amount spent is $200 after gold member discounts are

applied.
o If the gold discount puts the customer under the $200 threshold, the customer remains at gold

status.

Input: Input data will be stored in three files: preferred.dat, customers.dat and orders.dat. The total number of lines in each file will be unknown.

Preferred.dat will hold the data for preferred customers and customers.dat will hold the data for regular customers. Both files should be read at the beginning of the program to establish the preferred customer and regular customer arrays respectively. Preferred.dat may be empty or may not exist. In such cases, there should not be a preferred customer array created before reading the orders.

Each line of preferred.dat will be formatted as follows (except for the last line of the file which may not have a newline character). The data will be listed in the following order on each line with a space between each field. There will be no invalid data on any line.

customer ID
first name
last name
amount spent
discount or bonus bucks newline

Amount spent will indicate if the customer is gold or platinum. Discount will be a floating-point number for gold members or an integer value for platinum members.

Each line of customer.dat will be formatted as follows (except for the last line of the file which may not have a newline character). The data will be listed in the following order on each line with a space between each field. There will be no invalid data on any line.

customer ID

first name

last name

amount spent

newline

Orders.dat will hold all orders to process. Each valid line of the file will be formatted as follows (except for the last line of the file which may not have a newline character). A valid line will consist of data listed in the following order with a space between each field. There may be invalid data on any line. If a line contains invalid data, ignore everything on the line.

customer ID (string)
size (character) – S, M, or L
drink type (string) – soda, tea or punch square inch price (float)
quantity (integer)
newline

Invalid data: Invalid data can consist of any of the following:

incorrect number of fields (more or less than 5)

incorrect ID – doesn’t match an existing ID of a customer

incorrect value option for size or drink type

garbage characters – character present in value that is outside the data type’s acceptable character set

o example: a letter character in a value for a field with a numeric data type

Output: At the end of the program, write the regular customer data and preferred customer data to their respective files. Use the proper format as listed above in the Input section. There will be no output to the screen.

Explanation / Answer

Customer.java

package DrinkRewards;


public class Customer
{
    private String firstName;
    private String lastName;
    private String UID;
    private float amtSpent;
  
    Customer(String fNameIn, String lNameIn, String UIDin, float amtIn)
    {
        firstName = fNameIn;
        lastName = lNameIn;
        UID = UIDin;
        amtSpent = amtIn;
    }//End overloaded constructor
  
    Customer()
    {
        firstName = "";
        lastName = "";
        UID = "";
        amtSpent = 0;
    }//End default constructor
  
    public String getFirstName()
    {
        return firstName;
    }//End get first name accessor
  
    public String getLastName()
    {
        return lastName;
    }//End get last name accessor
  
    public String getUID()
    {
        return UID;
    }//End getUID accessor
  
    public float getAmtSpent()
    {
        return amtSpent;
    }//End get amtSpent accessor
  
    public void setLastName(String nameIn)
    {
        lastName = nameIn;
    }//End last name mutator
  
    public void setFirstName(String nameIn)
    {
        firstName = nameIn;
    }//End first name mutator
  
    public void setUID(String UIDin)
    {
        UID = UIDin;
    }//End UID mutator
  
    public void setAmt(float amtIn)
    {
        amtSpent = amtIn;
    }//End amt mutator
  
    public float getBenefit()
    {
        return amtSpent;
    }//End getDiscRate
  
    public String getStatus()
    {
        String status = "regular";
        return status;
    }//End getStatus()  
  
    public void setBenefit(float benefitIn) {}
  
    public void purchase(float cost)
    {
        amtSpent += cost;
    }//End purchase
  
  
}//End class Customer


GoldTier.java

package DrinkRewards;


public class GoldTier extends Customer
{
    private float discRate;
  
GoldTier(String firstName, String lastName, String UID, float amtSpent, float discRateIn)
    {
        super(firstName, lastName, UID, amtSpent);
        discRate = discRateIn;
    }//End constructor
  
    GoldTier()
    {
        super();
        discRate = (float) 0;
    }//End default constructor


    public float getBenefit()
    {
        return discRate;
    }//End discRate accessor
  
    public void setBenefit(float rateIn)
    {
        discRate = rateIn;
    }//End discRate mutator
  
    public String getStatus()
    {
        String status = "gold";
        return status;
    }//End getStatus
}//End class goldTier


Main.java

package DrinkRewards;

import java.io.*;
import java.util.Scanner;


public class Main
{
    public static void main(String[] args) throws FileNotFoundException
    {   //Generate customer/order data
        Customer[] regulars = buildRList();
        Customer[] preferred = buildPList();
        Customer[][] ListContainer;
        //Declare variables used for calculations
        float pSoda = .20f, pTea = .12f, pPunch = .15f;
        float aSmall = 56.5486f, aMed = 81.2887f, aLarge = 120.9513f;
        float amtDue = 0;
      
        Order[] orders = getOrders(regulars, preferred);
        //Process orders
        for (int i = 0; i < orders.length; i++)
        {
            //Check for type of drink
            if (orders[i].getType().equals("soda"))
            {
                //Check for size of drink
                if (orders[i].getSize() == 'S' || orders[i].getSize() == 's')
                {
                    //Calculate the price
                    amtDue = aSmall * orders[i].getPrice() + (12 * pSoda);
                    amtDue *= orders[i].getQuantity();
                }//End if
              
                //Check for size of drink
                else if (orders[i].getSize() == 'M' || orders[i].getSize() == 'm')
                {
                    //Calculate the price
                    amtDue = aMed * orders[i].getPrice() + (20 * pSoda);
                    amtDue *= orders[i].getQuantity();
                }//End else if
              
                //Check for size of drink
                else if (orders[i].getSize() == 'L' || orders[i].getSize() == 'l')
                {
                    //Calculate price
                    amtDue = aLarge * orders[i].getPrice() + (32 * pSoda);
                    amtDue *= orders[i].getQuantity();
                }//End else if
            }//End if
          
            //Check for type of drink
            else if (orders[i].getType().equals("tea"))
            {
                //Check for size of drink
                if (orders[i].getSize() == 'S' || orders[i].getSize() == 's')
                {
                    //Calculate price
                    amtDue = aSmall * orders[i].getPrice() + (12 * pTea);
                    amtDue *= orders[i].getQuantity();
                }//End if
              
                //Check for size of drink
                else if (orders[i].getSize() == 'M' || orders[i].getSize() == 'm')
                {
                    //Calculate price
                    amtDue = aMed * orders[i].getPrice() + (20 * pTea);
                    amtDue *= orders[i].getQuantity();
                }//End else if
              
                //Check for size of drink
                else if (orders[i].getSize() == 'L' || orders[i].getSize() == 'l')
                {
                    //Calculate price
                    amtDue = aLarge * orders[i].getPrice() + (32 * pTea);
                    amtDue *= orders[i].getQuantity();
                }//End else if
            } //End else if
          
            //Check for type of drink
            else if (orders[i].getType().equals("punch"))
            {
                //Check for size of drink
                if (orders[i].getSize() == 'S' || orders[i].getSize() == 's')
                {
                    //Calculate price
                    amtDue = aSmall * orders[i].getPrice() + (12 * pPunch);
                    amtDue *= orders[i].getQuantity();
                }//End if
              
                //Check for size of drink
                else if (orders[i].getSize() == 'M' || orders[i].getSize() == 'm')
                {
                    //Calculate price
                    amtDue = aMed * orders[i].getPrice() + (20 * pPunch);
                    amtDue *= orders[i].getQuantity();
                }//End else if
              
                //Check for size of drink
                else if (orders[i].getSize() == 'L' || orders[i].getSize() == 'l')
                {
                    //Calculate price
                    amtDue = aLarge * orders[i].getPrice() + (32 * pPunch);
                    amtDue *= orders[i].getQuantity();
                }//End else if
            }//End else if
                     
            int currentCustomer = findCust(regulars, orders[i].getUID());
          
            //Check to see if they are gold/platinum status
            if (currentCustomer == -1 )
            {              
                currentCustomer = findCust(preferred, orders[i].getUID());
                //If the customer is gold apply the discount rate
                if (preferred[currentCustomer].getStatus().equals("gold"))
                {
                    amtDue -= (amtDue * preferred[currentCustomer].getBenefit());
                    preferred[currentCustomer].purchase(amtDue);
                  
                    //Check to see if they are eligible for platinum status
                    if (preferred[currentCustomer].getAmtSpent() >= 200)
                    {
                        preferred = toPlatAtIndex(currentCustomer, preferred);
                    }//End if
                  
                    //Check to see if their discount increases
                    else if (preferred[currentCustomer].getAmtSpent() >= 150f)
                    {
                        preferred[currentCustomer].setBenefit(.15f);
                    }//End else if
                          
                    else if (preferred[currentCustomer].getAmtSpent() >= 100f)
                    {
                        preferred[currentCustomer].setBenefit(.10f);
                    }//End else if                                 
                }//End Gold Customer Purchase
              
                else
                {
                    amtDue -= preferred[currentCustomer].getBenefit();               
                    preferred[currentCustomer].setBenefit((int) ((int) amtDue / 5));
                    preferred[currentCustomer].purchase(amtDue);
                }//End else
            }//End preffered customer checkout
          
            else
            {
                float canUpgrade = amtDue + regulars[currentCustomer].getAmtSpent();
                regulars[currentCustomer].purchase(amtDue);
                if (regulars[currentCustomer].getAmtSpent() >= 200)
                {
                    regulars[currentCustomer].purchase(amtDue);
                    ListContainer = toPlatFromR(currentCustomer, regulars, preferred);
                    regulars = ListContainer[0];
                    preferred = ListContainer[1];
                }//End promote customer platnium
              
                else if(regulars[currentCustomer].getAmtSpent() - (amtDue * .15) >= 150)
                {
                    regulars[currentCustomer].purchase(-1 * amtDue);
                    amtDue -= amtDue * .15;
                    regulars[currentCustomer].purchase(amtDue);
                    ListContainer = toGoldAtIndex(currentCustomer, regulars, preferred, .15f);
                    regulars = ListContainer[0];
                    preferred = ListContainer[1];
                }//End promote customer to gold with 15%
              
                else if (regulars[currentCustomer].getAmtSpent() - (amtDue * .10) >= 100)
                {
                    regulars[currentCustomer].purchase(-1 * amtDue);
                    amtDue -= amtDue * .10;
                    regulars[currentCustomer].purchase(amtDue);
                    ListContainer = toGoldAtIndex(currentCustomer, regulars, preferred, .10f);
                    regulars = ListContainer[0];
                    preferred = ListContainer[1];
                }//End promote customer to gold with 10%
              
                else if (regulars[currentCustomer].getAmtSpent() - (amtDue * .05) >= 50)
                {
                    regulars[currentCustomer].purchase(-1 * amtDue);
                    amtDue -= amtDue * .05;
                    regulars[currentCustomer].purchase(amtDue);
                    ListContainer = toGoldAtIndex(currentCustomer, regulars, preferred, .05f);
                    regulars = ListContainer[0];
                    preferred = ListContainer[1];
                }//End promote customer to gold with 5%
              
                else
                {
                    regulars[currentCustomer].purchase(amtDue);
                }//End regular transaction
            }//End regular customer checkout
        }//End for
        overwrite(preferred, regulars);
      
    }//End main
  
    public static Customer[] buildRList() throws FileNotFoundException
    {
        Scanner input = new Scanner(new File("customers.dat"));
        String [] container = new String[20];
        int amtCustomers = 0;
        while (input.hasNext())
        {
            container[amtCustomers] = input.nextLine();
            amtCustomers++;
        }//End while
        Customer [] regularList = new Customer[amtCustomers];
        String [] parse;
        //1 2 0 3
        for (int i = 0; i < amtCustomers; i++)
        {
            parse = container[i].split(" ");
            regularList [i] = new Customer(parse[1], parse[2], parse[0], Float.parseFloat(parse[3]));
        }//End for
        input.close();
        return regularList;
    }//End buildRList
  
    public static Customer[] buildPList() throws FileNotFoundException
    {
        Scanner input = new Scanner(new File("preferred.dat"));
        String [] container = new String[20];
        int amtCustomers = 0;
        while (input.hasNext())
        {
            container[amtCustomers] = input.nextLine();
            amtCustomers++;
        }//End while
        Customer [] pList = new Customer[amtCustomers];
        String [] parse;
        //1 2 0 3
        for (int i = 0; i < amtCustomers; i++)
        {
            parse = container[i].split(" ");
            int length = parse[4].length();
            length -= 1;
            if (parse[4].charAt(length) == '%')
            {
                parse[4] = parse[4].replace("%","");
                if (Float.parseFloat(parse[4]) == 5.0f)
                {
                    pList [i] = new GoldTier(parse[1], parse[2], parse[0], Float.parseFloat(parse[3]), .05f);
                }//End if
              
                else if (Float.parseFloat(parse[4]) == 10.0f)
                {
                    pList [i] = new GoldTier(parse[1], parse[2], parse[0], Float.parseFloat(parse[3]), .10f);
                }//End else if
              
                else if (Float.parseFloat(parse[4]) == 15.0f)
                {
                    pList [i] = new GoldTier(parse[1], parse[2], parse[0], Float.parseFloat(parse[3]), .15f);
                }//End else if
              
                //Read in value anyways
                else
                    pList [i] = new GoldTier(parse[1], parse[2], parse[0], Float.parseFloat(parse[3]), Float.parseFloat(parse[4]));
              
            }//End if
          
            else
            {
                parse[4] = parse[4].replace("$","");
                pList [i] = new PlatinumTier(parse[1], parse[2], parse[0], Float.parseFloat(parse[3]), Float.parseFloat(parse[4]));
            }//End else
          
          
        }//End for
        input.close();
        return pList;
    }
  
    public static Order[] getOrders(Customer[] rList, Customer[] pList) throws FileNotFoundException
    {
       File rawOrders = new File("orders.dat");
       Scanner input = new Scanner(rawOrders);
       String [] rawData = new String [50];
       //String [] cleanData = new String [50];
       String [] parse;
       int amtOrders = 0;
       while (input.hasNext())
       {
           rawData [amtOrders] = input.nextLine();
           parse = rawData[amtOrders].split(" ");
           //Make sure data has 5 fields
           if (parse.length == 5)
           {
               //Make sure data matches an existing customer
               if (((findCust(rList, parse[0]) != -1) || (findCust(pList, parse[0]) != -1)))
               {
                   //Make sure data contains a valid size
                   if (parse[1].toUpperCase().equals("L") || parse[1].toUpperCase().equals("M") || parse[1].toUpperCase().equals("S"))
                   {
                       //Make sure data contains a valid type
                       if (parse[2].equals("soda") || parse[2].equals("tea") || parse[2].equals("punch"))
                       {
                            char[] container = parse[3].toCharArray();
                            boolean isNumber = true;
                            for (int i = 0; i < container.length; i++)
                            {
                                //Make sure data contains a valid price per square inch
                                if (container[i] < 46 || container[i] > 57 || container[i] == 47)
                                {
                                    isNumber = false;
                                }//End if
                            }//End for
                          
                            if (isNumber == true)
                            {
                                container = parse[4].toCharArray();
                                for (int i = 0; i < container.length; i++)
                                {
                                    //Make sure data contains a valid qty
                                    if (container[i] < 48 || container[i] > 57)
                                    {
                                        isNumber = false;
                                    }//End if
                                }//End for
                              
                                if (isNumber == true)
                                {
                                    amtOrders++;
                                }
                            }//End if
                       }//End if
                   }//End if
               }//End if
           }//End if
       }//End while
       Order[] orders = new Order[amtOrders];
       for (int i = 0; i < orders.length; i++)
       {
           parse = rawData[i].split(" ");
           orders[i] = new Order(parse[0], parse[1].charAt(0), parse[2], Float.parseFloat(parse[3]), Integer.parseInt(parse[4]));
       }//End for
       input.close();
       return orders;
    }//End get orders
  
    public static int findCust(Customer[] cList, String UID)
    {
      int index = -1;
      for(int i = 0; i < cList.length; i++)
      {
         if (cList[i].getUID().equals(UID))
         {
             index = i;
             break;
         }//End if
      }//End for
      return index;
    }//End findCust   
  
    public static Customer[][] toGoldAtIndex(int index, Customer[] rList, Customer[] pList, float rate)
    {
        Customer [] nRList = new Customer [(rList.length - 1)];
        Customer [] nPList = new Customer [(pList.length + 1)];
        for (int i = 0; i < nPList.length; i++)
        {
            if (i == (pList.length))
                nPList [i] = new GoldTier(rList[index].getFirstName(), rList[index].getLastName(), rList[index].getUID(), rList[index].getAmtSpent(), rate);
            else
                nPList[i] = pList[i];
        }//End for
        for (int i = 0; i < nRList.length; i++)
        {
            if (i < index)
            {
                nRList[i] = rList[i];
            }//End if
            else if (i >= index)
            {
                nRList[i] = rList[(i + 1)];
            }//End else if
        }//End for
        Customer[][] temp = {nRList, nPList};
        return temp;
    }//End toGoldAtIndex
  
    public static Customer[] toPlatAtIndex(int index, Customer[] pList)
    {
        float bonusBucks;
        bonusBucks = (int) (( (int) pList[index].getAmtSpent() - 200) / 5);
        pList[index] = new PlatinumTier(pList[index].getFirstName(), pList[index].getLastName(), pList[index].getUID(), pList[index].getAmtSpent(), bonusBucks);
        return pList;
    }//End toPlatAtIndex
  
    public static void overwrite(Customer [] pList, Customer [] rList) throws FileNotFoundException
    {
        PrintWriter output = new PrintWriter(new File("preferred.dat"));
        for (int i = 0; i < pList.length; i++)
        {
            if (pList[i].getStatus().equals("gold"))
            {
                if (pList[i].getBenefit() == .05f)
                {
                     output.println(pList[i].getUID() + " " + pList[i].getFirstName() + " " + pList[i].getLastName() + " " + pList[i].getAmtSpent() + " 5%");
                }//End 5%
              
                else if (pList[i].getBenefit() == .10f)
                {
                     output.println(pList[i].getUID() + " " + pList[i].getFirstName() + " " + pList[i].getLastName() + " " + pList[i].getAmtSpent() + " 10%");
                }//End 10%
              
                else if (pList[i].getBenefit() == .15f)
                {
                     output.println(pList[i].getUID() + " " + pList[i].getFirstName() + " " + pList[i].getLastName() + " " + pList[i].getAmtSpent() + " 15%");
                }//End 15%
            }//End gold print
            else
                output.println(pList[i].getUID() + " " + pList[i].getFirstName() + " " + pList[i].getLastName() + " " + pList[i].getAmtSpent() + " " + pList[i].getBenefit());
        }//End for
        output.flush();
        output.close();
        output = new PrintWriter(new File("customers.dat"));
        for (int i = 0; i < rList.length; i++)
        {
            output.println(rList[i].getUID() + " " + rList[i].getFirstName() + " " + rList[i].getLastName() + " " + rList[i].getAmtSpent());
        }//End for
        output.flush();
        output.close();
    }//End overwrite
  
    /*public static void printCustList(Customer [] customers)
    {
        for (int i = 0; i < customers.length; i++)
        {
            System.out.println(customers[i].getFirstName());
        }//End for
    }//End printCustList*/
  
    public static Customer[][] toPlatFromR(int index, Customer[] rList, Customer[] pList)
    {
        Customer[] nRList = new Customer [(rList.length - 1)];
        Customer[] nPList = new Customer [(pList.length + 1)];
        for (int i = 0; i < nRList.length; i++)
        {
            if (i < index)
            {
                nRList[i] = rList[i];
            }//End if
            else if (i >= index)
            {
                nRList[i] = rList[(i + 1)];
            }//End else if
        }//End for
      
        for (int i = 0; i < nPList.length; i++)
        {
           if (i == (pList.length))
                nPList [i] = new PlatinumTier(rList[index].getFirstName(), rList[index].getLastName(), rList[index].getUID(), rList[index].getAmtSpent(), 5);
            else
                nPList[i] = pList[i];
        }//End for
        nPList[pList.length].setBenefit((int) ((int) (rList[index].getAmtSpent() - 200) / 5));
        nPList[pList.length].setAmt(nPList[pList.length].getAmtSpent() - nPList[pList.length].getBenefit());
        nPList[pList.length].setBenefit(0f);
        Customer[][] temp = {nRList, nPList};
        return temp;
    }//End toPlatFromR
}//End class main

Order.java

package DrinkRewards;

public class Order
{
    private String UID;
    private char size;
    private String type;
    private float price;
    private int qty;
  
    Order()
    {
        UID = "";
        size = '0';
        type = "";
        price = 0;
        qty = 0;
    }//End default constructor
  
    Order(String UIDin, char sizeIn, String typeIn, float priceIn, int qtyIn)
    {
        UID = UIDin;
        size = sizeIn;
        type = typeIn;
        price = priceIn;
        qty = qtyIn;
    }//End constructor
  
    public String getUID()
    {
        return UID;
    }//End UID accessor
  
    public char getSize()
    {
        return size;
    }//End size accessor
  
    public String getType()
    {
        return type;
    }//End type accessor
  
    public float getPrice()
    {
        return price;
    }//End price accessor
  
    public int getQuantity()
    {
        return qty;
    }//End qty accessor

}//End class Order


PlatinumTier.java

package DrinkRewards;


public class PlatinumTier extends Customer
{
    private float bonusBucks;
  
    PlatinumTier(String firstName, String lastName, String UID, float amtSpent, float bucksIn)
    {
        super(firstName, lastName, UID, amtSpent);
        bonusBucks = bucksIn;
    }//End constructor
  
    PlatinumTier()
    {
        super();
        bonusBucks = (float) 0;
    }//End default constructor
  
    public float getBenefit()
    {
        return bonusBucks;
    }//End bonus bucks accessor
  
    public void setBenefit(float bucksIn)
    {
        bonusBucks = bucksIn;
    }//End bonus bucks mutator
  
    public String getStatus()
    {
        String status = "platinum";
        return status;
    }//End getStatus()
}