Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An Array Checker Program In this assignment you will implement a program that records a sequence of 10 integers entered by the user, and checks

An Array Checker Program In this assignment you will implement a program that records a sequence of 10 integers entered by the user, and checks to see if the sequence of integers was in increasing (also called non-decreasing) order. If the sequence is in order, the program prints the message List is in order. to the console. Otherwise the program prints List is not in order. Here is an example of what the input and output from your program should look like: Enter ten integers separated by spaces, then press return. 10 3 0 -4 200 80 -95 87 23 -67 List is not in order. Here is another example: Enter ten integers separated by spaces, then press return. -5 -4 -3 0 1 2 2 3 10 11 List is in order. Notice that, even when there are repeated numbers, as long as the sequence never decreases in value from one number to the next, the list is considered to be in order. So, sequences like 0 0 0 0 0 0 1 1 1 1 are considered to be in order. Your program needs to print the messages exactly as written above for the autograder. List must have a capital L and there must be a period after order. There are many ways to implement this program, and there are no constraints on the number of calls to System.out.println() or equals signs. However, we strongly suggest that you attempt to implement the program as follows: We suggest that you implement your program so that it stores the integers entered by the user by assigning the values to elements of an array of ints, just as with the ArrayRecorder and ArrayReverser assignments. You will need to place the code that accepts the integers from the user in a loop (a while or for loop) that executes 10 times. We also suggest that you place the code that checks the sequence of integers to see that it is non-decreasing in another loop that executes 9 times (more details on how to do this below). So, in total, youll need to create two separate loops. Your program should be in a class called ArrayChecker, in a file called ArrayChecker.java. Your starter code for this assignment will be the starter code from Assignment 3. No separate zip file is provided for this assignment. To read input from the console, you can use the A3Helper.java file just as you did for previous recent assignments. To get the Assignment 3 code and get it running on Eclipse or on the command line, follow the same instructions as for Assignment 3.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions