Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3 ZIPS, What Order?: Write a program named ZipOrder that the reads in three zip codes from standard input and prints to standard output one

3 ZIPS, What Order?: 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

More Books

Students also viewed these Databases questions

Question

Ensure that group members have accurate information.

Answered: 1 week ago

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago