Question: Lab 7: Methods 1. Write a Java program called Numbers that calls the following methods and displays the returned value: o Write a method called
Lab 7: Methods
1. Write a Java program called Numbers that calls the following methods and displays the returned value: o Write a method called cubeIt that accepts one integer parameter and returns the value raised to the third power as an integer.
2. Write a method called randomInRange that accepts two integer parameters representing a range. The method returns a random integer in the specified range inclusive. o Write a method called larger that accepts two double parameters and returns true if the first parameter is greater and false otherwise. Use the Boolean data type.
3. Write a Java program called Characters that calls the following methods and displays the returned value:
o Write a method called countA that accepts a String parameter and returns the number of times the character A is found in the string.
o Write a method called multiConcat that takes a String and integer as parameters. Return a String that consists of the string parameter concatenated with itself count times, where the count is the integer parameter. For example, if the parameter values are hi and 3, the return value is hihihi.
Display the returned values in main.
There is no user input.
Set up variables and change the values to test the methods.
Submit only one .java file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
