You Bubble Tea World store sells bubble teas. Having just opened the store, you decided to offer only the following flavors of bubble tea almond
You Bubble Tea World store sells bubble teas. Having just opened the store, you decided to offer only the following flavors of bubble tea almond milk, taro, and chai. Textures that can be added are boba, mango jelly, and pop boba and customer can order a single serve or double serve. The drinks can be ordered in either regular size of 12 oz. or large size of 16 oz. Design: The classes should be placed in a package with the name edu.ilstu Non-application classes BubbleTeaOrder and Rewards should have complete Javadoc comments. You will need to use the following classes for your program: BubbleTeaOrder class Keeps track of the information for one bubble tea order. This class should include the following: Named Constants a constant for sales tax of 7.5% a constant for the price of regular (12 oz.) bubble tea of $3.75 a constant for the price of large (16 oz) bubble tea of $4.50 a constant for the price of each texture added of 50 cents Instance Variables 4 instance variables for the counts of how many servings of each texture to add to the drink (will hold 1 or 2) An instance field for discount amount An instance field for size of the drink An instance field for flavor Methods Getters for each instance variable Setters for the count instance fields, size of drink, and flavor Getter for the bubble tea prices A method, applyDiscount, that accepts a Rewards object. This method will determine the amount of the discount based on the number of points stored in the Rewards object passed in. After the discount is determined, the method will also deduct the number of points used by calling the appropriate method in the Rewards object. Reward Points Deduct points 0 - 99 0 100 - 199 100 200 and above 200 A method, calculateSubTotal, that will calculate and return the cost of the bubble tea order. Calculation will be the price of the drink (12 oz or 16 oz) plus the cost of all the textures added to the drink less the discount. A method, calculateTaxAmount, that will calculate and return the tax amount based on the cost of the bubble tea order. Discount amount should not be taxed. A method calculateTotalCost, that will calculate and return the total cost of the order. The total cost will include the cost of the order and the tax amount less the discount. Rewards class Keeps track of the reward information for Bubble Tea World customers. This class should include the following: Instance variables a field to store full name a field to store account ID (phone number of the user, stores only numbers) a field to store the number of points that the customer has earned Methods a constructor that accepts values all instance fields getters for name and account number A method, addPoints, that accepts a money amount representing the sub total cost of the sale. This method will increase the number of points based on the amount passed in, each full dollar is worth 2 points. A method, deductPoints, that will accept a value representing the number of points to be deducted from the rewards account. A method, returnDiscountAmount, that returns the appropriate discount amount based on the number of points earned. Reward Points Charge 0 - 99 No discount 100 - 199 $1.00 200 and above $2.50 BubbleTeaOrderApp class This is the starting point for the application which is the only class to contain a main method. You will use the both the BubbleTeaOrder class and Rewards class here. For this program, the main method handles all of the input and output for the program. Create the instance of Rewards class and pass values for all arguments needed by the constructor. Create an instance of BubbleTeaOrder and pass values entered for the order. Follow the sample interaction on what to display for prompts, labels, messages and the flow for screen input and outputs. Ask what flavor Ask drink size Ask if customer wants textures. If answer is yes, ask if single (1) or double serving (2) for each texture. If the customer wants to use their reward points, apply the discount. If the phone number entered does not match the phone number in the Rewards object, display a message that the phone number is not found and there will be no discount. Only display the texture that was ordered by the customer. Review the sample runs of the program to determine how the interaction with the user should flow.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started