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

 

tmhscs@gmail.com fundamentals > fund_comboPrice
prev  |  next  |  chance

A restaurant is offering a combo deal. Whenever you buy a sandwich, salad, and drink at the same time, the price of the cheapest one will be free! Given the price of the sandwich, salad, and drink you picked out as decimals, return the price that you would pay for the combo where the cheapest one is free.

For example, if the sandwich costs $3.00, the salad costs $2.00, and the drink costs $1.00, the sum would be $6.00, but the combo price would be $5.00 because the drink would be free!


fund_comboPrice(3.0, 2.0, 1.0) → 5.0
fund_comboPrice(2.75, 1.25, 1.0) → 4.0
fund_comboPrice(1.0, 2.0, 3.0) → 5.0

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

public double fund_comboPrice(double sandwichPrice, double saladPrice, double drinkPrice) { }

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