java.lang.ObjectRecursionLab
public class RecursionLab
CPE 103 Lab. Simple recursion programs.
| Constructor Summary | |
|---|---|
RecursionLab()
|
|
| Method Summary | |
|---|---|
static int |
arrayPosTotal(int[] items,
int index)
Find the sum of the positive integers in an array (or part thereof) of ints. |
static int |
arrayTotal(int[] items,
int index)
Find the sum of the integers in an array (or part thereof) of ints. |
static int |
countSpaces(java.lang.String sentence)
Count the number of blank spaces in a string. |
static int |
findMax(int[] items,
int index)
Find the largest integer in an array (or part thereof) of ints. |
static boolean |
isPalindrome(java.lang.String sentence)
Determine if a string is a palindrome. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RecursionLab()
| Method Detail |
|---|
public static int arrayPosTotal(int[] items,
int index)
ints.
items - the array of numbers to be totalled.index - the starting index of the portion of the array
to be totalled (assuming the first position is index zero).
public static int arrayTotal(int[] items,
int index)
ints.
items - the array of numbers to be totalled.index - the starting index of the portion of the array
to be totalled (assuming the first position is index zero).
public static int countSpaces(java.lang.String sentence)
sentence - string to evaluate.
public static int findMax(int[] items,
int index)
ints.
items - the array of numbers to be searched.index - the starting index of the portion of the array
to be searched (assuming the first position is index zero).
public static boolean isPalindrome(java.lang.String sentence)
sentence - string to evaluate.