Search Results

Searching for: loops

Individual Exercises

0 / 50

Given an array of integers, return the sum of every other value in the array, starting with the first element. For example, if the array...

0 / 50

Given two integers size and num, return an array that can hold size integers and is filled with multiples of num, starting with num. For...

0 / 50

Given an array of integers, swap each pair of adjacent elements starting with the first two. For example, if the array contains the...

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

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

0 / 40

This method takes a String object as a parameter and returns a compressed version of the object. The method compresses the String by...

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...