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

 

abraskin@mbusd.org 2016_practice_set_6 > genderTimes
prev  |  next  |  chance

In a foot race each runner's time is measured in seconds stored in an array.
A second array records the gender of each runner as "M" for male, "F" for female, or "O" for other.
Given the two arrays and a gender as the third parameter, return a single array with only the times for the specified gender in it.


genderTimes([1.7, 1.5, 1.8, 1.5, 2.5, 2.1, 1.9], ["M", "F", "O", "F", "F", "M", "M"], "M") → [1.7, 2.1, 1.9]
genderTimes([1.7, 1.5, 1.8, 1.5, 2.5, 2.1, 1.9], ["M", "F", "O", "F", "F", "M", "M"], "F") → [1.5, 1.5, 2.5]
genderTimes([1.7, 1.5, 1.8, 1.5, 2.5, 2.1, 1.9], ["M", "F", "O", "F", "F", "M", "M"], "O") → [1.8]

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

public double[] genderTimes(double[] times, String[] genders, String selGender) { }

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

Copyright Nick Parlante 2017 - privacy