JOHN LUIS B.
DAGDAG
BSIT-102I
MP2- Machine
Problem 2 -
Conditional if, if-else
1.
JOHN LUIS B. DAGDAG
BSIT-102I
1. Write a program that will input a year code and output year level.
(Using JOptionPane)
Input => Year Code Output Output => Year Level
Year Code Output Year Level
1 "First Year" next line “Sophomore”
2 “Second Year” next line “Sophomore”
3 “Third Year” next line “Junior”
4 “Fourth Year” next line “Senior”
JOHN LUIS B. DAGDAG
BSIT-102I
2. Write a program for PIN Code / PUK Code verification for a cell
phone.
Initialize the PIN Code to 1234 and PUK code to 0123.
Prompt the user to enter a PIN Code. If the PIN code entered is
correct, display “Welcome to Smart…. Simply Amazing”.
If failed to enter the correct pin code, display “Invalid PIN
Code” and prompt the user to enter a PUK code.
If the PUK code is correct, display “Welcome to Smart….
Simply Amazing”.