Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //שליו שאולוב
- public class Book_store {
- public static void main(String[] args) {
- Book b1 = new Book("fortnite", "PS4", 2018, 50.0);
- b1.upOrDownPrice(10);
- Book b2 = new Book("GTAV", "PS4", 2014, 150.0);
- b2.upOrDownPrice(-10);
- Book b3 = new Book("warzoon", "PS4", 2020, 40.0);
- b3.upOrDownPrice(10);
- int newBook=0;
- if(b1.newOrOldBook(2020)) {
- newBook++;
- }
- if(b2.newOrOldBook(2020)) {
- newBook++;
- }
- if(b3.newOrOldBook(2020)) {
- newBook++;
- }
- System.out.println("the book "+b1.getName()+" is cost "+b1.getPrice());
- System.out.println("the book "+b2.getName()+" is cost "+b2.getPrice());
- System.out.println("the book "+b3.getName()+" is cost "+b3.getPrice());
- System.out.println("there is "+newBook+" new book");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement