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

 

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

Write a method that returns a string indicating the parity of the positive numbers in the 'nums' array. For any non-positive numbers, use a "#" to indicate that it was not a positive number. For positive numbers, use a "E" if it has even parity, or an "O" (the letter) if it has odd parity. Even numbers have even parity and odd numbers have odd parity. Look at the test data for examples.


test2023_09_08_HL_([27, 31, 55, 1, -5, -2, 0]) → "OOOO###"
test2023_09_08_HL_([52, 17, 13, 9, 22, 100, 84, 55, 203]) → "EOOOEEEOO"
test2023_09_08_HL_([-7, 23, 8, 0, 40, 41]) → "#OE#EO"

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

public String test2023_09_08_HL_(int[] nums) { }

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

Copyright Nick Parlante 2017 - privacy