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

 

tj@tjleone.com > lunchBill
prev  |  next  |  chance

Calculate the cost of lunch for the given number of people. The lunch special is fifteen dollars per person. Otherwise, lunch is 20 dollars per person.


lunchBill(2, true) → 30
lunchBill(5, false) → 100
lunchBill(6, true) → 90

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

public int lunchBill(int people, boolean lunchSpecial) { }

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: 115 Post-solution available

Copyright Nick Parlante 2017 - privacy