Question: Java using arrays For this solution make sure you change the formatting on your answer to Preformatted. We will NOT be grading you on whether

Java using arraysJava using arrays For this solution make sure you change the formatting

For this solution make sure you change the formatting on your answer to "Preformatted". We will NOT be grading you on whether you have selected "Preformatted", but it will make the grader's life easier. We WILL be grading you on whether your indentation is correct or not. Copy the skeleton of code below into your answer. Then in the space indicated, add your own code to prompt the user for a number, then read that many String values from the user. Your code should then print these strings 1 per line in the reverse order they were entered. See the transcripts below for some sample runs of this code (entries in BOLD are user entries): Enter a number: 3 Enter a string: String One Enter a string: String Two Enter a string: String Three You typed: String Three String Two string One A second run of this program with different input might look like this: Enter a number: 2 Enter a string: Hello Enter a string: Goodbye You typed: Goodbye Hello If the user enters a 0 or a negative number your code should print an error message and then end Enter a number: You must enter a value larger than zero! Use the skeleton of the main method below to write your code. public static void main(String[] args) { Scanner input = new Scanner(System.in); // TODO: Your code below this line input.close(); }

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!