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

 

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

Write a method that returns 'true' if you can go somewhere in your car, or 'false' if you cannot. To be able to go somewhere in your car you must have a car, and it must have gas and air in the tires. You must also have at least $20 just in case. Each of the input parameters represents one of these things in an obvious way. Look at the test data for examples. Remember, you must only have ONE return statement per method.


practiceQuiz2021_08_30_SLHL_canGo(true, true, true, 16) → false
practiceQuiz2021_08_30_SLHL_canGo(true, true, true, 22) → true
practiceQuiz2021_08_30_SLHL_canGo(true, true, true, 20) → true

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

public boolean practiceQuiz2021_08_30_SLHL_canGo(boolean car, boolean gas, boolean air, int money) { }

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

Copyright Nick Parlante 2017 - privacy