Program 1 (Worth 70 points) Write a program that generates values

advertisement
Program 1 (Worth 70 points)
Program 2 (worth 80 points)
Write a program that generates values
in an array. Ask for an integer input
between 50-100. Pass this value to a
method called method1. Method1
takes an integer parameter, creates an
integer array of size 20 with values that
are multiples of the number passed,
and displays the array.
Create two methods.
Method1 creates an array of size 20 and
returns that array as a return value.
Method2 takes an array as a parameter,
and prints the array out backwards.
In void main, call Method1. Method1
should call Method2 and pass the array
generated to Method2.
Program 3 (Worth 90 points)
Program 4 (worth 100 points)
Generate a random number between 0100. Display this number.
Project: Sort Array
If the number is between 0-50, call
Method 1 and pass that number.
Method 1 will create an array of size 10
with random numbers between 10-50
and display the results, but print all the
even values first.
If the number is between 51-100, call
Method 2 and pass that number.
Method 2 will create an array of size 10
with random numbers between 10-50
and display the results. In this method,
sum up all the values of this array and
print it out as well.
In void main, create an integer array
called array1 of size 20.
Create a method called AssignValues
that will take an integer array as a
parameter, assign values to it, and
return it as a return type.
Set array1 equal to AssignValues and
and use array1 as a parameter.
Now create a method called SortArray.
SortArray will take an integer array as a
parameter and sort it from least to
greatest and display the results.
Call SortArray and use array1 as a
parameter.
Download