about | help | code help+videos | done | prefs |
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250
Copyright Nick Parlante 2017 - privacy