Convert Arabic numerals to Roman. ie 5 returns V, 12 returns XII.
Difficulty: Easy
Write a method that will take a string as input, and return a new string with the same letters in reverse order.
Don't use String's reverse method; that would be too simple.
Difficulty: easy
Write a method that takes an integer
n
in; it should return the result ofn*(n-1)*(n-2)*...*(n-(n-1))
. Assume n >= 0.
As a special case,
factorial(0) == 1
Difficulty: easy.
Write a method that takes in a string. Return the longest word in the string. You may assume that the string contains only letters and spaces. You may use the String
split
method to aid you in your quest.
Difficulty: easy.
Write a method that takes in an integer
num
and returns the sum of all integers between zero and num, up to and includingnum
.
Difficulty: easy.