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

 

sspiege3@schools.nyc.gov > countMales
prev  |  next  |  chance

Complete the method countMales that accepts an arraylist named list that contains strings, The method must count up and return the number of times that the string "male" is found in the list. Please note the list may have no elements


countMales([]) → 0
countMales(["male"]) → 1
countMales(["female"]) → 0

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

public int countMales( List <String> list){ }

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

Copyright Nick Parlante 2017 - privacy