

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Instructions for writing pseudocode to determine if a given sequence of unique integers is increasing or not. The sequence is defined as one where each value is greater than the preceding one, and is terminated by the special value -999. The pseudocode should be detailed enough to be converted into java code by a competent programmer, but should not contain java-specific details.
Typology: Quizzes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


CMSC131 Fall 2004 Quiz #3, Duration 25 Minutes
First Name: Last Name: Student Id: Section time (10am/11am): TAs:
Write pseudocode for a program that reads a sequence of unique integer values and determines whether it is an increasing sequence. An increasing sequence is one where each value is greater than the preceding one. The sequence will be terminated by the special value -999, which is not considered to be part of the sequence. The program will print the message "Increasing" for an increasing sequence and "Non-Increasing" otherwise. For example, here are two increasing sequences:
The following are two non-increasing sequences:
You may assume that the sequence will have at least two integer values and no two values will be equal.
To keep things simple, you can read in the next integer and store it in some variable x as follows:
x = read()
You can print a value x or message as follows:
print(x) or print(“Hello”)