Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package testfix;
- import java.util.*;
- public class bookstore {
- public static void main(String[] args) {
- Scanner in= new Scanner(System.in);
- int sum=0;
- for (int i=1; i<=3; i++)
- {
- System.out.println("enter book name");
- String bkname= in.nextLine();
- System.out.println("enter writer name");
- String wrname= in.nextLine();
- System.out.println("enter publishing year");
- int pub= in.nextInt();
- System.out.println("enter price");
- int price= in.nextInt();
- System.out.println("enter lesson of new price");
- int upd=in.nextInt();
- book bk1=new book (bkname,wrname,pub,price);
- System.out.println("enter current year");
- int d= in.nextInt();
- if (bk1.ifNew(d))
- {
- sum++;
- }
- System.out.println("name of the book:"+bkname+" "+"updated price:"+(bk1.newprice(upd)));
- }
- System.out.println("amount of new books:"+sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement