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

 

jebbert@volusia.k12.fl.us > quiz2023_09_12_P1SLHL_laptopFine
prev  |  next  |  chance

Write a method that determines how much you owe for damaged or lost laptop items. If you have a broken screen, it costs $150. A damaged keyboard costs $75. A missing cord costs $25. You might also have another problem, in which case the cost depends on the problem you have. The parameter 'otherProblem' is true if you have another problem, in which case 'costOther' is added to the total that you owe. All the other parameters should be obvious in their meaning. Look at the test data for examples.


quiz2023_09_12_P1SLHL_laptopFine(false, true, true, true, 2) → 102
quiz2023_09_12_P1SLHL_laptopFine(false, false, true, false, 500) → 75
quiz2023_09_12_P1SLHL_laptopFine(true, true, true, false, 100) → 250

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

public int quiz2023_09_12_P1SLHL_laptopFine(boolean brokenScreen, boolean missingCord, boolean damagedKeyboard, boolean otherProblem, int costOther) { }

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

Copyright Nick Parlante 2017 - privacy