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

 

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

Write a method that accepts a string array of Disney World ride names called 'rides' and an integer array of associated wait times called 'waitTime'. As preconditions you may assume that both arrays are of the same length, although that length could be zero for both of them. There is also an input parameter called 'ride'. The ride in 'rides' matches the wait time in 'waitTime' at the same index. Your goal is to return the correct wait time for the indicated ride. The name of the ride given in 'ride' must EXACTLY match the name given in 'rides', including having the same capitalization and punctuation. If there is no match, return 9999 as an error code. As always, look at the test data for examples.


test2024_08_29_SLHL_waitTimes([], [], "Astro Orbiters") → 9999
test2024_08_29_SLHL_waitTimes(["Winnie the Pooh", "It's a Small World", "Haunted Mansion", "Tiki Room"], [50, 10, 90, 10], "Tiki Room") → 10
test2024_08_29_SLHL_waitTimes(["Winnie the Pooh", "It's a Small World", "Haunted Mansion", "Tiki Room"], [50, 10, 90, 10], "Small World") → 9999

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

public int test2024_08_29_SLHL_waitTimes(String[] rides, int[] waitTime, String ride) { }

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