Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class priceCalculator {
- public static void main(String[] args) {
- System.out.println("Welcome to the price calculator.");
- System.out.println();
- double subtotal = 49.50;
- double tax = 0.09;
- double taxTotal = subtotal * tax;
- double grandTotal = taxTotal + subtotal;
- double displayTax = tax * 100;;
- System.out.println("The subtotal is " + subtotal);
- System.out.println("The tax is " + displayTax + "%");
- System.out.println("The grand total is " + grandTotal);
- System.out.println("Thank you for using the price calculator.");
- }
- }
- and heres some other bs:
- import java.awt.Color;
- import javax.swing.JFrame;
- import javax.swing.JTextField;
- public class FrameTester {
- public static void main(String[] args) {
- JFrame frame = new JFrame();
- frame.setSize(200, 200);
- JTextField text = new JTextField("Hello, World!");
- text.setBackground(Color.PINK);
- frame.add(text);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement