+1 (315) 557-6473 

Create Console Based Output in Java Assignment Solution.


Instructions

Objective
Write a Java assignment program to create console-based output in the Java language. Your task is to write a program that generates console-based output using Java. This assignment aims to test your understanding of basic Java syntax and your ability to produce program output. Make sure to follow the instructions provided and submit your solution according to the given guidelines. This assignment will help you practice your Java programming skills and enhance your familiarity with console input and output operations in Java.

Requirements and Specifications


Program to create console based output in java

Source Code

public class Kicks {

    final static int MAX_VALUE = 100;

    final static int LARGE_ORDER_THRESHOLD = 10;

    final static double DISCOUNT = 20.00;

    private int size;

    private String brand;

    private double price;

    private int qty;

    public Kicks(){

        this(10, "Adidas", 65.99, 1);

    }

    public Kicks(int size, String brand, double price, int qty){

        this.size = size;

        this.brand = brand;

        this.price = price;

        this.qty = qty;

    }

    public int getSize() {

        return size;

    }

    public void setSize(int size) {

        this.size = size;

    }

    public String getBrand() {

        return brand;

    }

    public void setBrand(String brand) {

        this.brand = brand;

    }

    public double getPrice() {

        return isLargeOrder() ? (price - DISCOUNT) : price;

    }

    public void setPrice(double price) {

        this.price = price;

    }

    public int getQty() {

        return qty;

    }

    public void setQty(int qty) {

        this.qty = qty;

    }

    public boolean isLargeOrder() {

        return qty >= LARGE_ORDER_THRESHOLD;

    }

    public void displayShoeInfo(){

        System.out.println("Shoe Size >>" + size);

        System.out.println("Shoe Brand >>" + brand);

        System.out.println("Shoe Price >>" + price);

        System.out.println("Quantity >>" + qty);

        System.out.println("Total Price >>" + qty * getPrice());

        System.out.println("Large order >>" + isLargeOrder());

    }

    public static void displayMotto(){

        System.out.println("- - - - - - - - - - -" +

        "\n| Cobell's Kicks | " +

        "\n| Flyest kicks | " +

        "\n| Sleakest Styles |" +

        "\n| Get Style today |" +

        "\n- - - - - - - - - - -");

    }

    public static void displayThanks() {

        System.out.println("Thank you for the purchase come again");

    }

    public static Kicks getLarger(Kicks kicks1, Kicks kicks2) {

        double totalPrice1 = kicks1.qty * kicks1.getPrice();

        double totalPrice2 = kicks2.qty * kicks2.getPrice();

        int diff = Double.compare(totalPrice1, totalPrice2);

        if (diff < 0) {

            return kicks2;

        }

        else {

            return kicks1;

        }

    }

}