Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ee.tthk.tarpe17;
- import java.util.Scanner;
- public class ProductTester {
- public static void main(String[] args) {
- Scanner in=new Scanner(System.in);
- int tempNumber;
- String tempName;
- int tempQty;
- double tempPrice;
- System.out.println("Enter an id:");
- tempNumber=in.nextInt();
- System.out.println("Enter a name:");
- tempName=in.next();
- System.out.println("Enter quantity:");
- tempQty=in.nextInt();
- System.out.println("Enter a price:");
- tempPrice=in.nextDouble();
- Product p1=new Product(tempNumber,tempName,tempQty,tempPrice);
- int tempNumber2;
- String tempName2;
- int tempQty2;
- double tempPrice2;
- System.out.println("Enter an id:");
- tempNumber2=in.nextInt();
- System.out.println("Enter a name:");
- tempName2=in.next();
- System.out.println("Enter quantity:");
- tempQty2=in.nextInt();
- System.out.println("Enter a price:");
- tempPrice2=in.nextDouble();
- Product p2=new Product(tempNumber2,tempName2,tempQty2,tempPrice2);
- /*Product salt=new Product();
- Product cheese=new Product();
- Product lettuce=new Product(1,"Maxima lehtkapsas",2000,0.80);
- Product tomato=new Product(2,"Maxima tomatid",1000,1.2);
- Product flour=new Product(3,"Veski mati jahu",3000,1.6);
- Product vodka=new Product(4,"Laua viin",2500,6.99);
- System.out.println(salt);
- System.out.println(cheese);
- System.out.println(lettuce);
- System.out.println(tomato);
- System.out.println(flour);
- System.out.println(vodka);
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement