Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.chandler;
- public class Main {
- public static void main(String[] args) {
- boolean gameOver = true;
- int score = 800;
- int levelCompleted = 5;
- int bonus = 100;
- calculateScore(true, 800, levelCompleted, bonus);
- score = 10000;
- levelCompleted = 8;
- bonus = 200;
- if(gameOver) {
- int finalScore = score + (levelCompleted * bonus);
- System.out.println("Your final score was " + finalScore);
- }
- }
- public static void calculateScore(boolean gameOver, int score, int levelCompleted, int bonus) {
- boolean gameOver = true;
- int score = 800;
- int levelCompleted = 5;
- int bonus = 100;
- if(gameOver) {
- int finalScore = score + (levelCompleted * bonus);
- finalScore += 1000;
- System.out.println("Your final score was " + finalScore);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement