Search Results

Searching for: if loops

Individual Exercises

0 / 50

Given a string str and an int n, return a string made of the first n characters of the string, followed by the first n - 1 characters of...

0 / 10

Write a function that returns true if a is even, false otherwise. Just for practice, you must use an if statement.

0 / 10

This method takes an integer array as a parameter and returns true if the array includes an odd integer; otherwise, the method returns...

0 / 20

This methods takes a String object as a parameter and returns an encrypted version of the object. The encryption is done in two steps:...

0 / 10

This method simulates flipping a fair coin. It takes an integer parameter, which specifies the number of times that the coin is to be...

0 / 20

This method simulates flipping a fair coin. The coin is flipped repeatedly until three heads are seen. The method takes an integer...

0 / 10

This method takes an ArrayList of integers as a parameter and does not return anything. The method will expand the list with a mirrored...

0 / 20

This method takes an ArrayList of integers as a parameter and does not return anything. The method will remove all of the odd elements in...

0 / 20

This method takes an ArrayList of integers as a parameter and does not return anything. The method will repeat each odd element in the...