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

 

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

Write a method that accepts an array of names containing exactly two names. There is also an integer input parameter called 'count'. Return a string of the form "Igloo contains: " followed by the first name repeated count times then the second name repeated count times. Notice that there is a space between each name and a space at the end of the whole string. Your program must work for any value of count including zero and negatives. However if count is negative or zero you must return "Igloo empty"


iglooMultiplePeople(["Tom", "Jones"], 0) → "Igloo empty"
iglooMultiplePeople(["Sam", "Jane"], 3) → "Igloo contains: Sam Sam Sam Jane Jane Jane "
iglooMultiplePeople(["Kermit", "John"], 1) → "Igloo contains: Kermit John "

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

public String iglooMultiplePeople(String[] names, int count) { }

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

Copyright Nick Parlante 2017 - privacy