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

 

dvermes@scarsdaleschools.org > getOrderTotal
prev  |  next  |  chance

A "Be Prepared" test prep book costs $18.95; "Next Best" costs $21.95. A site called apzone.com offers a special deal: both for $37.95. If you buy three or more copies (in any mix of these two titles), they are $15.98 each. If you buy 12 or more copies, you pay only $14.00 for each. Write a method that calculates the total for an order of bp copies of "Be Prepared" and nb copies of "Next Best," taking the above specials into account.


getOrderTotal(1, 1) → 37.95
getOrderTotal(1, 0) → 18.95
getOrderTotal(0, 1) → 21.95

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

public double getOrderTotal(int bp, int nb) { }

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: 130

Copyright Nick Parlante 2017 - privacy