id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

fund_marioScore


In the video game "Super Mario 3D World" for the Nintendo Wii U, every level in the game has 3 green stars, one stamp, and a flag. Each time Mario collects a green star, you get 4000 points added to your score. If you collected the stamp, you get another 4000 points. Finally, when you touch the flag pole at the end of the level, you get between 100 and 10000 points depending on how high on the flag pole you reached.

Given an integer of how many of the 3 green stars you collected, a boolean of whether or not you got the stamp, and an integer of the amount of points you got from the flag pole, return your score for that level of the game.


fund_marioScore(3, true, 10000) → 26000
fund_marioScore(3, false, 10000) → 22000
fund_marioScore(1, true, 5000) → 13000

...Save, Compile, Run (ctrl-enter)

public int fund_marioScore(int greenStars, boolean gotStamp, int flagPoints) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy