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

 

simona1@sfusd.edu functions1 > getShippingCharge
prev  |  next  |  chance

Given the weight of a package, return the shipping charge based on the following rates. If the package weight is 2 pounds or less, the rate is $1.1; if the package weight is over 2 pounds, but not more than 6 pounds, the rate is $2.2; if the package weight is over 6 pounds, but not more than 10 pounds, the rate is $3.7; if the package weights more than 10 pounds, the rate is $3.8.


getShippingCharge(1) → 1.1
getShippingCharge(3.5) → 2.2
getShippingCharge(7.9) → 3.7

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

public double getShippingCharge(double weight){ }

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

Copyright Nick Parlante 2017 - privacy