Question: For each of the following exercises, write the Java code statements to perform the action(s) requested. Submit your code statements and a capture of your

For each of the following exercises, write the Java code statements to perform the action(s) requested. Submit your code statements and a capture of your outputs for each exercise.



1. Take 5 integers from a user and store them in an array and then print them on the display screen in reverse order.



2. Modify the method created in #1 to take in 5 integers from a user and store them in an array. Then ask the user to repeat one of the ten numbers.
Respond to the user that yes, the number is in the list or no, the number is not in the list.



3. Accept 15 integers from a user and print the following: (The pattern of the numbers entered is up to you: it can be a compressed string on 1-digit values [with repetitions] - 12345678901235; or space delimited - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; or any other format you wish to use).


a. number of positive numbers
b. number of negative numbers
c. number of odd numbers
d. number of even numbers
e. the largest number
f. the smallest number
g. number of 0s.


4. Find the accumulative product of the elements of an array containing 5 integer values. For example, if an array contains the integers 1,2,3,4, & 5, a method would perform this sequence: ((((1 x 2) x 3) x 4) x 5) = 120.


5. Create 2D array that contains student and their classes using the data shown in the following table. Ask the user to provide a name and respond with the classes associated with that student.


Joe CS101 CS110 CS255
Mary CS101 CS115 CS270
Isabella CS101 CS110 CS270
Orson CS220 CS255 CS270


6. Using the 2D array created in #5, ask the user for a specific course number and list to the display the names of the students enrolled in that course.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

ACTIVITY 1 import javautilScanner public class Exercise1 public static void mainString args int numbers new int5 Scanner scanner new ScannerSystemin SystemoutprintlnEnter 5 integers for int i 0 i 5 i ... View full answer

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 Programming Questions!