CJCoding With Joseph
15free / daySign inCreate account
TitleOpen
150
Format Currency with NumberFormatUse Java's NumberFormat class to read a decimal and print it as Canadian currency.
easyNot startedSolve
151
Format Percent with NumberFormatUse Java's NumberFormat class to read a decimal ratio and print it as a percentage with exactly one decimal place.
easyNot startedSolve
152
Round with DecimalFormat 2 PlacesUse Java's DecimalFormat class to read a decimal and round it to exactly 2 decimal places.
easyNot startedSolve
153
Pad Integer with DecimalFormatUse Java's DecimalFormat class to read an integer and print it padded with leading zeros to exactly 5 digits.
easyNot startedSolve
154
Enum Day BasicUse a Java enum to represent days of the week and print the current day.
easyNot startedSolve
155
Enum Traffic Light with ifUse a Java enum and an if statement to determine and print the action for a traffic light.
easyNot startedSolve
166
Enum with Field and ConstructorUse an enum with a constructor, field, and getter method to store and retrieve a numeric priority level.
easyNot startedSolve
206
Catch NullPointerExceptionThe variable name is set to null.
easyNot startedSolve
207
Catch ArrayIndexOutOfBoundsExceptionAn array contains three values: {10, 20, 30}.
easyNot startedSolve
208
Finally Block Always RunsThe try and catch blocks are already set up for division.
easyNot startedSolve
209
Parse Double with Default FallbackRead one line of input.
easyNot startedSolve
210
Catch StringIndexOutOfBoundsExceptionRead a word and an index on the same line.
easyNot startedSolve
211
Multiple Catch BlocksRead a string from input.
easyNot startedSolve
212
Throw IllegalArgumentExceptionThe method checkPositive(int n) should throw an IllegalArgumentException with the message "Must be positive" if n is zero or negative.
easyNot startedSolve
213
Catch Any ExceptionThe try block parses the input as an integer and accesses that index of "Java".
easyNot startedSolve
214
Read Exception InfoThe method triggerError() throws an IllegalStateException with the message "Connection lost".
easyNot startedSolve
215
Safe Array Access MethodComplete the method safeGet(int[] arr, int index).
easyNot startedSolve
401
Ternary Operator Even or OddAn integer n = 7 is given.
easyNot startedSolve
402
Reverse a String with StringBuilderThe string s = "hello" is given.
easyNot startedSolve
403
Integer to Binary StringThe integer n = 13 is given.
easyNot startedSolve
404
Math max and minTwo integers a = 8 and b = 15 are given.
easyNot startedSolve
405
Join Strings with String.joinAn array fruits = {"apple", "banana", "cherry"} is given.
easyNot startedSolve
156
Enum Switch Shipping CostUse an enum and a switch statement to determine and print a shipping cost based on the selected method.
mediumNot startedSolve
157
DecimalFormat Grouping and Two DecimalsUse DecimalFormat to read a large decimal and print it with comma grouping separators and exactly 2 decimal places.
mediumNot startedSolve
158
NumberFormat Locale ComparisonUse NumberFormat to read a decimal and print it as currency in two different locales: US and Germany.
mediumNot startedSolve
159
Enum Parse from InputRead a string from input, convert it to uppercase, and use Enum.valueOf() to parse it into a Level enum constant.
mediumNot startedSolve
160
Enum Ordinal and NameUse enum built-in methods to print the name and zero-based ordinal position of a Season constant.
mediumNot startedSolve
161
DecimalFormat Optional DecimalsUse DecimalFormat with the pattern '0.##' to format a decimal, removing unnecessary trailing zeros.
mediumNot startedSolve
162
NumberFormat Integer GroupingUse NumberFormat.getIntegerInstance() to read a large integer and print it with comma grouping separators.
mediumNot startedSolve
163
Enum Loop ValuesUse a for-each loop with Enum.values() to iterate over all constants in the Status enum and print each one.
mediumNot startedSolve
167
Enum from int with helper methodComplete the static fromScore() method that maps an integer to a Rank enum constant, then read a score and print the result.
mediumNot startedSolve
169
NumberFormat Compact Currency SummaryRead a price and tax amount, compute the total, and print all three as formatted US currency using a single NumberFormat instance.
mediumNot startedSolve
216
Custom RuntimeExceptionBuild a stock-checking system: 1.
mediumNot startedSolve
217
Multi-Catch with | OperatorWrite a program that reads a string from input.
mediumNot startedSolve
218
Finally for Resource CleanupSimulate opening and closing a database connection.
mediumNot startedSolve
219
Checked Exception and throwsCreate a checked exception and use it: 1.
mediumNot startedSolve
220
Exception ChainingWrite a method loadConfig(String input) that tries to parse input as an integer using Integer.parseInt().
mediumNot startedSolve
221
Validate Score with Custom ExceptionBuild a score validation system from scratch: 1.
mediumNot startedSolve
222
Nested Try-CatchWrite a program that reads a string.
mediumNot startedSolve
223mediumNot startedSolve
224
Re-throw Exception After LoggingWrite a method parse(String s) that tries to parse s as an integer.
mediumNot startedSolve
225
Count Valid Integers in a LoopRead 5 lines of input.
mediumNot startedSolve
406
Bitwise AND OR and XORTwo integers a = 12 and b = 10 are given.
mediumNot startedSolve
407
Count Digits and LettersRead one line of text from standard input.
mediumNot startedSolve
408
Sum with VarargsWrite a static method named sum that accepts a variable number of int arguments (varargs) and returns their total.
mediumNot startedSolve
164
DecimalFormat Negative Currency StyleFormat a negative decimal as accounting-style currency where negatives appear in parentheses instead of with a minus sign.
hardNot startedSolve
165
NumberFormat Parse and ReformatRead a comma-formatted number string, parse it back to a numeric value with NumberFormat, then reprint it with exactly 2 decimal places.
hardNot startedSolve
168
DecimalFormat Scientific NotationUse DecimalFormat to read a number and format it in scientific notation with exactly 2 decimal places.
hardNot startedSolve
409
Word Frequency with TreeMapThe array words = {"apple", "banana", "apple", "cherry", "banana", "apple"} is given.
hardNot startedSolve
410
Sort Strings by Length with ComparatorThe array words = {"banana", "fig", "apple", "kiwi"} is given.
hardNot startedSolve