diff --git a/src/main/java/edu/unl/cse/soft160/before_and_after/InClassAfterRefactor.java b/src/main/java/edu/unl/cse/soft160/before_and_after/InClassAfterRefactor.java index 23f292c35cf841f1f17b87813a201eaf19dfece5..cb6c0745adedef20ee49454bb9a437335179f156 100644 --- a/src/main/java/edu/unl/cse/soft160/before_and_after/InClassAfterRefactor.java +++ b/src/main/java/edu/unl/cse/soft160/before_and_after/InClassAfterRefactor.java @@ -10,28 +10,28 @@ import java.util.Scanner; */ public class InClassAfterRefactor { - private static double getShippingWeight(String prompt, Scanner scanner) { - System.out.print(prompt); - double weightOfItem = Double.parseDouble(scanner.nextLine()); - return weightOfItem; - } + private static double getShippingWeight(String prompt, Scanner scanner) { + System.out.print(prompt); + double weightOfItem = Double.parseDouble(scanner.nextLine()); + return weightOfItem; + } - private static void displayResult(double shippingCost, double weightOfFirstItem, double weightOfSecondItem) { - System.out.println("Weight of the items is " + weightOfFirstItem + " and " + weightOfSecondItem - + " and the shipping cost is " + shippingCost + "."); - } + private static void displayResult(double shippingCost, double weightOfFirstItem, double weightOfSecondItem) { + System.out.println("Weight of the items is " + weightOfFirstItem + " and " + weightOfSecondItem + + " and the shipping cost is " + shippingCost + "."); + } - private static double computeShippingCost(double weightFirstItem, double weightSecondItem) { - double shippingCost = (weightFirstItem + weightSecondItem) * 2.50; - return shippingCost; - } + private static double computeShippingCost(double weightFirstItem, double weightSecondItem) { + double shippingCost = (weightFirstItem + weightSecondItem) * 2.50; + return shippingCost; + } - public static void main(String[] args) { - Scanner scanner = new Scanner(System.in); - double weightFirstItem = getShippingWeight("Enter the weight of the first item: ", scanner); - double weightSecondItem = getShippingWeight("Enter the weight of the second item: ", scanner); - scanner.close(); - double shippingCost = computeShippingCost(weightFirstItem, weightSecondItem); - displayResult(shippingCost, weightFirstItem, weightSecondItem); - } + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + double weightFirstItem = getShippingWeight("Enter the weight of the first item: ", scanner); + double weightSecondItem = getShippingWeight("Enter the weight of the second item: ", scanner); + scanner.close(); + double shippingCost = computeShippingCost(weightFirstItem, weightSecondItem); + displayResult(shippingCost, weightFirstItem, weightSecondItem); + } }