×
Samples Blogs Make Payment About Us Reviews 4.9/5 Order Now

Create Console Based Output in Java Assignment Solution

June 19, 2024
Dr. Alexandra Burke
Dr. Alexandra
🇦🇺 Australia
Java
With a Ph.D. from the University of Melbourne, Dr. Alexandra is a seasoned expert in Java programming, boasting over 8 years of experience. Having successfully completed 900+ Java assignments, Dr. Alexandra's profound understanding and meticulous approach ensure unparalleled quality and precision in every project.
Key Topics
  • Instructions
    • Objective
  • Requirements and Specifications
Tip of the day
Use Python libraries effectively by importing only what you need. For example, if you're working with data, using libraries like pandas and numpy can save time and simplify complex tasks like data manipulation and analysis.
News
In 2024, the Biden-Harris Administration has expanded high-dosage tutoring and extended learning programs to boost academic achievement, helping programming students and others recover from pandemic-related setbacks. These initiatives are funded by federal resources aimed at improving math and literacy skills​

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 (1)

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; } } }

Similar Samples

Explore our portfolio of programming samples at ProgrammingHomeworkHelp.com. Our curated examples cover a wide range of languages and concepts, offering clear demonstrations of our problem-solving skills. Whether you're studying basic syntax or advanced algorithms, these samples serve as valuable learning resources. Discover how our solutions can assist you in mastering programming challenges effectively.