Question: How would this work on jGrasp in Java ? Add a new java class to your existing folder. Put your name as a comment on

How would this work on jGrasp in Java ?

Add a new java class to your existing folder.

Put your name as a comment on the top of the class.

You will be generating random numbers so import java.util.Random.

You should consider developing the methods for this project incrementally.

In main, use an initializer list create an array of ints called nums holding the following values: 1, 4, 13, 43, -25, 17, 22, -37, 29

Write a method, called findLargest, that returns the largest value in the array and have the client print the result

Create an int array of size 20, called data and write a method to fill the array with random ints [-100, 100]. Recall that randoms nextInt( x) method returns a value from 0 to x-1. The upper bound is exclusive. Modify the values to fit the required ranges.

Use the findLargest method you previously wrote to return the largest value in data for the client to print

Print the sum of the largest values from nums and data

Print the contents of data.

Find the length of the longest continuous series of positive numbers in the array data. If the contents were: 4 5 0 2 . . . -1 88 78 66 -6. The length would be 3. For this problem, 0 is considered non-negative but not positive.

This is as far as I've gotten, but I'm lost

import java.util.Random; public class Lab1AArray { public static void main(String[] args) { int[] nums = {1,4,13,43,-25,17.22,-37.29} { public static int findLargest(int[] nums)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!