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

 

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

Write a method that returns how spooky a haunted house is. The spookiness is determined by how many ghosts, vampires, and skeletons are present. However, some of these are more scary than others. Ghosts have a scariness factor of 7, while vampires have a factor of 9 and skeletons have a factor of 4. So if a haunted house has one of each, its scariness factor would be 20. If they only have two ghosts and nothing else, the scariness factor would be 14. Look at the test data for other examples.


oct31_2019_APP1SLHL_spooky(7, 1, 2) → 66
oct31_2019_APP1SLHL_spooky(8, 22, 5) → 274
oct31_2019_APP1SLHL_spooky(1, 1, 1) → 20

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

public int oct31_2019_APP1SLHL_spooky(int ghosts, int vamps, int skeletons) { }

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

Copyright Nick Parlante 2017 - privacy