Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. public class priceCalculator {
  2.     public static void main(String[] args) {
  3.         System.out.println("Welcome to the price calculator.");
  4.         System.out.println();
  5.  
  6.         double subtotal = 49.50;
  7.         double tax = 0.09;
  8.         double taxTotal = subtotal * tax;
  9.         double grandTotal = taxTotal + subtotal;
  10.         double displayTax = tax * 100;;
  11.  
  12.         System.out.println("The subtotal is " + subtotal);
  13.         System.out.println("The tax is " + displayTax + "%");
  14.         System.out.println("The grand total is " + grandTotal);
  15.         System.out.println("Thank you for using the price calculator.");
  16.     }
  17. }
  18. and heres some other bs:
  19. import java.awt.Color;
  20. import javax.swing.JFrame;
  21. import javax.swing.JTextField;
  22. public class FrameTester {
  23.     public static void main(String[] args) {
  24.         JFrame frame = new JFrame();
  25.         frame.setSize(200, 200);
  26.         JTextField text = new JTextField("Hello, World!");
  27.         text.setBackground(Color.PINK);
  28.         frame.add(text);
  29.         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  30.         frame.setVisible(true);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement