Methods labnbspnbsp 1 write a java program called numbers


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

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

2. 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.  Check out the Methods video listed with the Chapter Five Activities

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Methods labnbspnbsp 1 write a java program called numbers
Reference No:- TGS01145482

Expected delivery within 24 Hours