Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1. public class Main {
  2.  
  3.     public static void main(String[] args) {
  4.         boolean gameOver = true;
  5.         int score = 800;
  6.         int levelCompleted = 5;
  7.         int bonus = 100;
  8.  
  9. //        if (score == 5000) {
  10. //            System.out.println("Your score was 5000");
  11. //        }
  12. //
  13. //        if (score <5000 && score >1000) {
  14. //            System.out.println("Your score was less than 5000 but greater than 1000");
  15. //        } else if (score < 1000) {
  16. //            System.out.println("Your score was less than 1000");
  17. //        } else {
  18. //            System.out.println("Got here");
  19. //        }
  20.  
  21.         if (gameOver) {
  22.             int finalScore = score + (levelCompleted * bonus);              // cannot be used outside of this code block (SCOPE)
  23.             System.out.println("Your final score was " + finalScore);
  24.         }
  25.  
  26.         boolean newGameOver = true;
  27.         int newScore = 10000;
  28.         int newLevelCompleted = 8;
  29.         int newBonus = 200;
  30.  
  31.         if (newGameOver) {
  32.             int newFinalScore = newScore + (newLevelCompleted * newBonus);
  33.             System.out.println("Your new final score is " + newFinalScore);
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement