Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----DISCOUNT BILL-----\\
- public class DiscountBill extends GroceryBill
- {
- private int numOfDiscount;
- private double DiscountPrice;
- private double discountPercent;
- public DiscoutBill(Employee clerk, boolean preferred) {
- super(clerk);
- }
- public int getDiscoutCount() {
- return numOfDiscount;
- }
- public double getDiscountAmount() {
- return DiscountPrice;
- }
- public double getDiscountPercent() {
- return discountPercent;
- }
- }
- //-----CASH-----\\
- public class Cash
- {
- //CASH CODE NOT PROVIDED... WILL JUST PUT THE EQUALS METHOD!
- private int amount;
- public boolean equals (int addAmount) {
- return amount == addAmount;
- }
- }
- //-----RECTANGLE-----\\
- public class Rectangle
- {
- //DO NOT HAVE REACTANGLE CLASS... WILL JUST PUT EQUALS METHOD!
- private int width;
- private int height;
- public boolean equals (int oWidth, int oHeight) {
- return width == oWidth && height == oHeight;
- }
- }
- //-----TRIANGLE-----\\
- public class Triangle
- {
- //DO NOT HAVE TRIANGLE CLASS... WILL JUST PUT EQUALS METHOD!
- private int base;
- private int height;
- public boolean equals (int oBase, int oHeight) {
- return base == oBase && height == oHeight;
- }
- }
- //-----CIRCLE-----\\
- public class Circle
- {
- //DO NOT HAVE CIRCLE CLASS... WILL JUST PUT EQUALS METHOD!
- private int radius;
- public boolean equals (int oRadius) {
- return radius == oRadius;
- }
- }
- //-----OCTAGON-----\\
- public class Octagon extends Shape
- {
- //DONT HAVE SHAPE SUPERCLASS SO DONT KNOW WHAT TO INCLUDE... WILL GUESSTIMATE.
- private int side;
- private double area;
- public Octagon (int sideLength)
- {
- side = sideLength;
- }
- public int getLength() {
- return side;
- }
- public int getPerimeter()
- {
- return side*8;
- }
- public double getArea()
- {
- return area;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement