You are on page 1of 7

Computer Programming 1

MPT3- Guided Exercises 3 - (using if,if-else)

Panti, John Cedric I.


BS – IT 101I
USING A SCANNER

1. Write a program that will input a number and evaluate if the


number is a “Positive” or “Negative” or “Zero”. If the number is
positive display the message “POSITIVE NUMBER”, if negative
“NEGATIVE NUMBER, and if zero displays the message “ZERO”.

CODE
OUTPUTS:

POSITIVE

NEGATIVE

ZERO
USING A BUFFERED READER

CODE:
OUTPUTS:
POSITIVE

NEGATIVE

ZERO
USING A JOPTIONPANE

CODE:
OUTPUTS:

POSITIVE

NEGATIVE

ZERO

You might also like