100% found this document useful (1 vote)
380 views3 pages

MP2 - Machine Problem 2 - Conditional If, If-Else (Dagdag)

The document contains code for two programs written by John Luis B. Dagdag for his BSIT-102I machine problem 2 assignment. The first program uses an if/else statement to output the year level based on the input year code. The second program verifies a PIN code and allows entry of a PUK code if the PIN is incorrect. It displays a welcome message if either code is correct.

Uploaded by

John Dagdag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
380 views3 pages

MP2 - Machine Problem 2 - Conditional If, If-Else (Dagdag)

The document contains code for two programs written by John Luis B. Dagdag for his BSIT-102I machine problem 2 assignment. The first program uses an if/else statement to output the year level based on the input year code. The second program verifies a PIN code and allows entry of a PUK code if the PIN is incorrect. It displays a welcome message if either code is correct.

Uploaded by

John Dagdag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

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”.

You might also like