Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (true) {
- String kozunakRate = scanner.nextLine();
- if(i == kozunaci){
- if (kozunakRate.equals("Close")) {
- if(rate > winnerRate){
- winnerRate = rate;
- System.out.println(chef + rate);
- System.out.println(chef + "is the winner!");
- break;
- }else{
- System.out.println(chef + rate);
- System.out.println(winnerChef+ "is the winner!");
- break;
- }
- }
- }else {
- if (kozunakRate.equals("Close")) {
- if(rate > winnerRate){
- winnerRate = rate;
- winnerChef = chef;
- System.out.println(chef + "is the new number 1!");
- }
- System.out.println(chef + rate);
- break;
- } else {
- int rateInteger = Integer.valueOf(kozunakRate);
- rate = rate + rateInteger;
- }}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement