Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- ShoppingCart sc = new ShoppingCart(); // Create the shopping cart
- Scanner scanner = new Scanner(System.in); // Create the scanner
- sc.setTaxRate(0.08); // Set the TaxRate
- for (int i = 0; i < 3; i++) { // Ask the user for input 3 times
- sc.getInput(scanner); // Actually asking for input using the getInput method
- }
- System.out.print("Pre-tax total price: "); // Printing:
- System.out.print(sc.getPreTaxTotalPrice()); // Using getters to to get the variables we want
- System.out.print("\nTax Rate: ");
- System.out.print(sc.getTaxRate());
- System.out.print("\nTotal Price: ");
- System.out.print(sc.getTotalPrice());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement