Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * written by Tariq Scott
- */
- import java.util.Scanner;
- public class AppleTester {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- System.out.println("Welcome to the Apple Tester");
- System.out.println("Would you like the first, second, third, or fourth apple?");
- String userInput = keyboard.nextLine();
- Apple first = new Apple("Red Delicious", 2.0, 4.00);
- Apple second = new Apple ("Gala", .75, 0.89);
- Apple third = new Apple ("Golden Delicious", 1.0, 3.00);
- Apple fourth = new Apple ("Granny Smith", 0.5, 2.50);
- System.out.println("Name: " + first + "Weight: "+ this.weight + "Price: " + this.price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement