Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN JAVA Write a program named ZipOrder that the reads in three zip codes from standard input and prints to standard output one of three

IN JAVA

Write a program named ZipOrder that the reads in three zip codes from standard input and prints to standard output one of three words: "ASCENDING", "DESCENDING", "UNSORTED". The zip codes are guaranteed to be distinct from each other. In particular:

if each zip code read in is greater than to the previous one, "ASCENDING" is printed.

if each zip code read in is less than to the previous one, "DESCENDING" is printed.

otherwise, "UNSORTED" is printed.

The program accomplishes this by reading the zip codes and passing them as arguments to a method named direction. This method returns a string ("ASCENDING", "DESCENDING", or "UNSORTED") that the program prints out. The function carries out the zip code order logic.

CONSTRAINT: You must define and use the method direction.

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

Step: 3

blur-text-image

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

What is the difference between a call option and a put option?

Answered: 1 week ago

Question

2. Place a value on the outcomes.

Answered: 1 week ago