Write the method boolean areAllOdd(int[] nums) in Java that returns true if all elements in the array nums are odd numbers, and returns...
Search Results
Searching for: conditionals
Individual Exercises
Write the method boolean areAllGreaterThan(int[] nums, int x) in Java that returns true if all elements in the array nums are greater...
Write the method boolean areAllLessThan(int[] nums, int x) in Java that returns true if all elements in the array nums are less than the...
Write the method int sumAllPositives(int[] nums) in Java that returns the sum of all elements in the array nums that are positive.
Write the method int sumBeforeNegative(int[] nums) in Java that returns the sum of the elements in the array nums up till the first...
Write the method int sumAfterNegative(int[] nums) in Java that returns the sum of the elements in the array nums after the first negative...
Write the method String convertName(String name) in Java that implements the following logic: Given a string in the form of "last_name,...
Write the method String convertDate(String name) in Java that implements the following logic: Given a data in string format in the form...
Write the method String convertTime(String time) in Java that implements the following logic: Given a time in 24hr format, often refered...
Write the method String convertPhone(String number) in Java that implements the following logic: Given a phone number as a string of...
Write the method boolean hasPrefix(String word) in Java that returns true if the string in word begins with one of these prefixes:
"pre",...
Write the method boolean hasSuffix(String word) in Java that returns true if the string in word ends with one of these suffixes:
"er",...
Write the method boolean containsRoot(String word) in Java that returns true if the string in word contains inside (see below) one of...
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...
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 ...
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...
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 ...
For this question you can assume you have access to two jeroo variables. One named tom and one named jerry.
Change the if statement so...
For this question you can assume you have access to three jeroo variables. One named tom, one named steve, and one named jerry.
Change if...
For this question, we will be working with a subclass of Jeroo called CountingJeroo that tracks the number of hops it has peformed. You...
For this question, we will be working with a subclass of Jeroo called CountingJeroo that tracks the number of hops it has peformed. You...
For this question, we will be working with a subclass of Jeroo called CountingJeroo that tracks the number of hops it has peformed. You...
The Rectangle class below has two integer fields to store its length and width. The toString() method should do the following:
- If the...