Search Results

Searching for: conditional

Individual Exercises

0 / 50

The number 6 is a truly great number. Given two `int` values, `a` and `b`, return true if either one is 6. Or if their sum or difference is 6....

0 / 50

When squirrels get together for a party, they like to have cigars. A squirrel party is successful when the number of cigars is between 40...

0 / 50

You and your date are trying to get a table at a restaurant. The parameter `you` is the stylishness of your clothes, in the range 0..10,...

0 / 50

You have a green lottery ticket, with `int`s `a`, `b`, and `c` on it. If the numbers are all different from each other, the result is 0. If all...

0 / 50

Write a method called `listUpper()` that takes in a list of strings, and returns a list of the same length containing the same strings but...

0 / 50

Write a method called `listSearch()` that takes in a target string and a list of other strings. This method returns a (possibly shorter)...

0 / 20

Given a string, consider the prefix string made of the first N chars of the string. Does that prefix string appear somewhere else in the...

0 / 30

Returns true if for every '*' (star) in the string, if there are chars both immediately before and after the star, they are the same.

0 / 30

Given two strings, `base` and `remove`, return a version of the `base` string where all instances of the `remove` string have been removed (not...

0 / 20

Given a string, return true if the number of appearances of "is" anywhere in the string is equal to the number of appearances of "not"...

0 / 20

We'll say that a "triple" in a string is a char appearing three times in a row. Return the number of triples in the given string. The...

0 / 20

We'll say that a lowercase 'g' in a string is "happy" if there is another 'g' immediately to its left or right. Return true if all the...

0 / 30

Given a string, return the length of the largest "block" in the string. A block is a run of adjacent chars that are the same.

0 / 40

Given a string, look for a mirror image (backwards) string at both the beginning and end of the given string. In other words, zero or...

0 / 50

Given a string, return the sum of the numbers appearing in the string, ignoring all other characters. A number is a series of 1 or more...

0 / 40

Given a string, return a string where every appearance of the lowercase word "is" has been replaced with "is not". The word "is" should...

0 / 50

Write a function in Java that implements the following logic: Given a string, if the string begins with "red" or "blue" return that color...

0 / 50

Below is some code your co-worker implemented, but they're asking you for help because it's not working the way they want it to.

The code...

0 / 50

You notice some co-worker's code is both not working and is overly complicated.

The code should act in the following way:

• if value is ...
0 / 50

Below is some code your co-worker implemented, but they're asking you for help because it's not working the way they want it to.

The code...

0 / 50

Below is some code your co-worker tried again to implement letter grade code, but it is still not working the way they want.

The code ...