Advertisement
scaawt

Lab11pt2

Oct 15th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. /**
  2.  * written by Tariq Scott
  3.  */
  4. import java.util.Scanner;
  5. public class AppleTester {
  6.  
  7.   public static void main(String[] args) {
  8.     Scanner keyboard = new Scanner(System.in);
  9.    
  10.     System.out.println("Welcome to the Apple Tester");
  11.     System.out.println("Would you like the first, second, third, or fourth apple?");
  12.    
  13.     String userInput = keyboard.nextLine();
  14.    
  15.     Apple first = new Apple("Red Delicious", 2.0, 4.00);
  16.     Apple second = new Apple ("Gala", .75, 0.89);
  17.     Apple third = new Apple ("Golden Delicious", 1.0, 3.00);
  18.     Apple fourth = new Apple ("Granny Smith", 0.5, 2.50);  
  19.    
  20.     System.out.println("Name: " + first + "Weight: "+ this.weight + "Price: " + this.price);
  21.    
  22.   }
  23.  
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement