Advertisement
Guest User

test

a guest
Nov 21st, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. public void rating (){
  2. Scanner kb = new Scanner(System.in);
  3. do{
  4.  
  5. System.out.println("What do you feel about the book? (Rating:1 to 5) 1 is Terrible, and 5 is Great\n");
  6. rate= kb.nextInt();
  7. ans = addRating(rate);
  8. System.out.println("exited addRating");
  9. if (ans==true){
  10. System.out.println("Do you want to rate again? y or n");
  11. choice = kb.nextLine();
  12. switch (choice){
  13. case "y":case "yes":
  14.  
  15. break;
  16. case "n":case "no":
  17. tabulate();
  18. break;
  19. default:
  20. System.out.println("Sorry, please choose between the two");
  21.  
  22. }
  23.  
  24. count++;
  25. }
  26. }while (ans == true && ans==false && count<6 &&!choice.equalsIgnoreCase("yes") &&!choice.equalsIgnoreCase("no")&&!choice.equalsIgnoreCase("y") &&!choice.equalsIgnoreCase("n"));
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement