Fill in the for loops in the following method. This method needs to iterate through the 3D array and set each slot to 5.3.
Search Results
Searching for: io
Individual Exercises
Implement the following method so that it counts the number of times the target
character appears in the given string and returns the...
The following method takes in a 2 dimensional array as a parameter. Set the first value in each row to 10, then return the array.
Write a method that will return true
if int num
is even.
The following method takes in a 1-dimensional array of integers and should change every item that has an even index to the number 100....
The following method takes in a 2D array of characters. for each row at an even index, change every item in that row to '*'.
For example:...
In math, multiplying a matrix by a single number is straightforward. For example, if you had a 2D array of ints
int [][] numbers = { {1,...
The following method takes in an int
representing some number of inches. Implement it so that it returns a string reporting the number of...
The following method takes in a 2D character array. Somewhere in that array, there may be one '*'
character. This method should find that...
The following method will appear in a class with a generic type parameter T
. It takes in a 2D array of elements of that generic type T
,...
Write a function in C++ called factorial()
that will take a positive integer as input and returns its factorial as output.
The method below takes in two sets of integer values called setA
and setB
. Create a new set of integers, then add any value that is in...
A teacher is tracking grades for two sections of a class using two maps. Each map uses the student's name as a key with their grade is...
The method below takes in two integers as parameters and should throw an IllegalArgumentException
if either parameter is the number 5. In...
The method below takes an array of Jeroos and should throw an exception if any Jeroo in the array is null
or if any is facing North.
In...
The method below takes in a String parameter representing a username. It should throw an Exception
if the username is less than 3...
The method divideValues()
will throw an IllegalArgumentException
if either parameter is 5. The method below takes two integer values as...
The validateJeroo()
method takes in an array of Jeroo objects and could throw two different exceptions.
If a Jeroo in the array is null,...
The following code runs a method called validateUser()
that will throw an IllegalArgumentException
if a username (passed in as a...
Write a function called school
that takes a string
that represents the day of the week and displays the corresponding message:
- monday:...
Write a recursive function called add_digits
that will receive a positive number and returns the sum of each of digits. For example,...
Write a recursive function called half_left
that will receive a measurement of the amount of a chemical that is decaying. The amount will...
Write a recursive function called is_increasing
that will receive a vector of integers called list and determine whether or not it is...
Write a program that makes a decision and does something so that if the input is 1
the output is 0
and vice versa.
Write the code that...
Write a program that prompts the user to login, and displays appropriate messages according to whether the details are correct, partially...