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

 

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

Write a method that determines how many hours of fun you are planning on having over Spring Break. Your method accepts two arrays, an array of strings with verbal descriptions of the different activities you will do, and an array of integers specifying how many hours you will spend on the corresponding activity. All "fun" activities will have strings that start with "fun:" (all lower case). Any "fun" actitiy should could towards your total hours of fun. Any other activty will NOT count towards your total. The two arrays will be of the same length.


SpringBreakHoursOfFun(["what: fun", "lotso: fun", "fun: fun"], [3, 6, 11]) → 11
SpringBreakHoursOfFun(["fun:", "fun:", "fun:", "fun:", "fun:", "Fun:", "FUN:"], [1, 2, 3, 4, 5, 6, 7]) → 15
SpringBreakHoursOfFun(["fun:"], [1512]) → 1512

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

public int SpringBreakHoursOfFun(String[] activities, int[] hours) { }

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