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

 

getPizzaCost


A pizza restaurant near you is having a special for a medium pie with up to 3 free toppings for $9.95. Every topping after that is an additional $2. Complete the method getPizzaCost, which takes one parameter, an int numToppings and returns the pizza cost.


getPizzaCost(4) → 11.95
getPizzaCost(1) → 9.95
getPizzaCost(2) → 9.95

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

public double getPizzaCost(int numToppings){ }

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

Difficulty: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy