You are on page 1of 6

Name: Ken L.

Soberano Date: November 07, 2023


Year & Section: CpE – 2101 Subject: Programming, Logic, and Design

Activity 5
PSEUDOCODE:
Decoration welcome_decorator(welcome):

Module wrapper(*args, **kwargs):

Display "Welcome, You may now convert your unit using this program!"

return welcome(*args, **kwargs)

return wrapper

Call welcome_decorator

Module feet_to_inches():

Display “Enter the number of feet: “

Input the number of feet

Set inches = feet * 12

Display "{feet} feet is equal to {inches} inches."

Display "{feet} feet = {inches} inches"

return inches

Call welcome_decorator

Module inches_to_feet():

Display “Enter the number of inches: “

Input the number of inches

Set feet = inches / 12

Display "{inches} inches is equal to {feet} feet."

Display "{inches} inches = {feet} feet"

return feet

Module main():

while True:

Display "Choose an action to perform (Please input 1 to 3):"

"1. Feet to Inches"

"2. Inches to Feet"

"3. Quit”
Display “Enter your choice of action: ”

Input Your choice of action

Set if choice == '1':

Call module feet_to_inches()

Set elif choice == '2':

Call module inches_to_feet()

Set elif choice == '3':

Display “Thank you. Please keep using this unit conversion program. Goodbye!"

break (end)

Set else:

Display "Your choice is an invalid choice. Please select from 1, 2, 3 only."

main()

FLOWCHART:
True

False

True

False

True

False
PROGRAM:

You might also like