CJCoding With Joseph
15free / daySign inCreate account
TitleOpen
99
Function: Square a NumberComplete the function square so it returns its argument multiplied by itself.
easyNot startedSolve
100
Function: Cube a NumberComplete the function cube so it returns its argument raised to the third power.
easyNot startedSolve
101
Function: Add Two NumbersComplete the function add so it returns the sum of its two parameters.
easyNot startedSolve
102
Function: Maximum of TwoComplete the function maxOf so it returns the larger of its two parameters.
easyNot startedSolve
103
Function: Minimum of TwoComplete the function minOf so it returns the smaller of its two parameters.
easyNot startedSolve
104
Function: Absolute ValueComplete the function absValue so it returns the absolute value (magnitude) of its parameter.
easyNot startedSolve
105
Function: Is EvenComplete the function isEven so it returns 1 if its parameter is even and 0 if it is odd.
easyNot startedSolve
106
Function: Sum from 1 to NComplete the function sumTo so it returns the sum of all integers from 1 up to n (inclusive).
easyNot startedSolve
107
Function: FactorialComplete the function factorial so it returns n!
easyNot startedSolve
108
Function: Celsius to FahrenheitComplete the function toFahrenheit so it converts a whole-number Celsius temperature to Fahrenheit using the formula F = C 9 / 5 + 32.
easyNot startedSolve
109
Function: Rectangle AreaComplete the function area so it returns the area of a rectangle (width times height).
easyNot startedSolve
110
Function: PowerComplete the function power so it returns base raised to exp using a loop (do not use pow()).
easyNot startedSolve
111
Function: Count DigitsComplete the function countDigits so it returns how many digits a positive integer has.
easyNot startedSolve
112
Function: Is PrimeComplete the function isPrime so it returns 1 if n is a prime number and 0 otherwise.
easyNot startedSolve
113
Function: Average of ThreeComplete the function average so it returns the integer average of its three parameters (their sum divided by 3).
easyNot startedSolve
226
Square a Number with a FunctionWrite a function named square that takes one integer parameter and returns that number multiplied by itself.
easyNot startedSolve
227
Add Two Numbers Using a FunctionDefine a function named add that takes two integer parameters and returns their sum.
easyNot startedSolve
228
Larger of Two Numbers (Drill)Write a function named maxOf that takes two integers and returns whichever one is larger (return either value if they are equal).
easyNot startedSolve
229
Even or Odd CheckerCreate a function named isEven that takes an integer and returns 1 if the number is even and 0 if it is odd.
easyNot startedSolve
230
Cube a NumberDefine a function named cube that takes an integer and returns the number multiplied by itself three times (n n n).
easyNot startedSolve
231
Absolute Value FunctionWrite a function named absValue that takes an integer and returns its absolute value (the number without its sign).
easyNot startedSolve
232
Rectangle Area FunctionCreate a function named area that takes two integers, a width and a height, and returns the area of the rectangle (width times height).
easyNot startedSolve
346
Function: Multiply Two NumbersWrite a function multiply(int a, int b) that returns the product of a and b.
easyNot startedSolve
347
Function: Subtract Two NumbersWrite a function subtract(int a, int b) that returns a - b.
easyNot startedSolve
348
Function: Is OddWrite a function isOdd(int n) that returns 1 when n is odd and 0 when it is even.
easyNot startedSolve
349
Function: Double a NumberWrite a function doubleValue(int n) that returns n multiplied by 2.
easyNot startedSolve
350
Function: Circle AreaWrite a function circleArea(double r) that returns the area of a circle using pi = 3.14159 (area = pi r r).
easyNot startedSolve
351
Function: Fahrenheit to CelsiusWrite a function toCelsius(double f) that converts Fahrenheit to Celsius using (f - 32) 5 / 9.
easyNot startedSolve
352
Function: Triangle AreaWrite a function triangleArea(double base, double height) that returns 0.5 base height.
easyNot startedSolve
353
Function: Is VowelWrite a function isVowel(char c) that returns 1 if c is a lowercase vowel (a, e, i, o, u) and 0 otherwise.
easyNot startedSolve
354
Function: To UppercaseWrite a function toUpper(char c) that converts a lowercase letter to uppercase by subtracting 32 from its character code.
easyNot startedSolve
355
Function: Nth Triangular NumberWrite a function triangular(int n) that returns the nth triangular number using the formula n (n + 1) / 2.
easyNot startedSolve
356
Function: Print a Line N TimesWrite a void function printLines(int n) that prints Hi on its own line n times.
easyNot startedSolve
357
Function: Is DivisibleWrite a function isDivisible(int a, int b) that returns 1 if a is evenly divisible by b and 0 otherwise.
easyNot startedSolve
358
Function: Half a NumberWrite a function half(double n) that returns n divided by 2.
easyNot startedSolve
114
Function: Greatest Common DivisorComplete the function gcd so it returns the greatest common divisor of two positive integers.
mediumNot startedSolve
115
Function: Reverse a NumberComplete the function reverseNum so it returns the digits of a positive integer reversed.
mediumNot startedSolve
116
Function: Sum of DigitsComplete the function sumDigits so it returns the sum of the digits of a positive integer.
mediumNot startedSolve
117
Function: Nth FibonacciComplete the function fib so it returns the nth Fibonacci number (1-indexed, where fib(1)=0, fib(2)=1, and each later term is the sum of the previous two).
mediumNot startedSolve
118
Function: Is Palindrome NumberComplete the function isPalindrome so it returns 1 if a positive integer reads the same forwards and backwards, and 0 otherwise.
mediumNot startedSolve
119
Function: Count VowelsComplete the function countVowels so it returns how many lowercase vowels (a, e, i, o, u) are in a string.
mediumNot startedSolve
120
Function: Maximum of an ArrayComplete the function maxOfArray so it returns the largest value in an integer array.
mediumNot startedSolve
233
Factorial with a FunctionWrite a function named factorial that takes a non-negative integer n and returns n!
mediumNot startedSolve
234
Prime Number CheckerWrite a function named isPrime that takes an integer and returns 1 if it is prime and 0 otherwise.
mediumNot startedSolve
235
Sum of Digits (Practice)Write a function named sumDigits that takes a non-negative integer and returns the sum of its individual digits (for example, 1234 gives 1 + 2 + 3 + 4 = 10).
mediumNot startedSolve
359
Function: Maximum of ThreeWrite a function max3(int a, int b, int c) that returns the largest of three integers.
mediumNot startedSolve
360
Function: Minimum of ThreeWrite a function min3(int a, int b, int c) that returns the smallest of three integers.
mediumNot startedSolve
361
Function: Sum of ArrayWrite a function sumArray(int arr[], int n) that returns the sum of the first n elements of arr.
mediumNot startedSolve
362
Function: Average of ArrayWrite a function average(int arr[], int n) that returns the average of the n elements as a double.
mediumNot startedSolve
363
Function: Count Even Numbers in ArrayWrite a function countEven(int arr[], int n) that returns how many of the first n elements are even.
mediumNot startedSolve
364
Function: Is Leap YearWrite a function isLeap(int y) that returns 1 if year y is a leap year, else 0.
mediumNot startedSolve
365
Function: Clamp a ValueWrite a function clamp(int x, int lo, int hi) that returns lo if x is below the range, hi if x is above it, and x otherwise.
mediumNot startedSolve
366
Function: Sum of Squares from 1 to NWrite a function sumSquares(int n) that returns 1^2 + 2^2 + ...
mediumNot startedSolve
367
Function: Count Occurrences in ArrayWrite a function countOccurrences(int arr[], int n, int target) that returns how many times target appears among the first n elements.
mediumNot startedSolve
121
Function: Recursive FactorialComplete the function factorial so it computes n!
hardNot startedSolve
122
Function: Recursive Sum to NComplete the function sumTo so it returns the sum of all integers from 1 to n using RECURSION (no loops).
hardNot startedSolve
123
Function: Swap with PointersComplete the function swap so it exchanges the values of two integers using POINTERS.
hardNot startedSolve
368
Function: Recursive PowerWrite a recursive function power(int base, int exp) that returns base raised to exp (assume exp >= 0).
hardNot startedSolve
369
Function: Recursive GCDWrite a recursive function gcd(int a, int b) that returns the greatest common divisor using Euclid's algorithm: if b == 0 return a, otherwise return gcd(b, a % b).
hardNot startedSolve
370
Function: Reverse a StringWrite a function reverse(char s) that reverses the characters of the string s in place using two indices (or pointers) that move toward the middle and swap.
hardNot startedSolve