0% found this document useful (0 votes)
13 views38 pages

Compilation Portfolio

Compilation

Uploaded by

harvyescarda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views38 pages

Compilation Portfolio

Compilation

Uploaded by

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

COMPILATION PORTFOLIO

on
CC102

Harvy Escarda
BSIT-1

Submitted to:
Jan Melvey Sabal
"Hello World"
The purpose of this code is to print or display an
Hello World text.
"Find the sum"
The purpose of this code is to calculate the sum
of two digits.
"Area of the rectangle"
The purpose of this code is to calculate the area
of rectangle by multiplying its length and width.
"BMI Calculator"
The purpose of this code is to calculate the BMI
index by multiplying the height on its own and
then devided it to weight.
"Simple Calculator"
The purpose of this code is to calculate the sum,
difference, product, and quotient of the two
digits that you input.
"Temperature Converter"
The purpose of this code is to convert the
temperature in fahrenheit to celsius by
(fahrenheit - 32) then multiply to 5.0 and lastly
dividing it to 9.0 in order to get the temperature
in celsius.
"Time Converter"
The purpose of this code is to add up all seconds in hours, minutes,
and seconds you input by multiplying hours to 3600 since 1 hour
consist of 3600 seconds in order to get the equivalent seconds of
corresponding hours, same as the minutes that you multiply it to 60
since it consist 60 seconds in 1 minuted in order to get the
equivalent seconds of corresponding minutes. After that, add the
seconds of hours, minutes, and seconds that you input to get the
equivalent total seconds.
"Activity 1 (Equal or Not Equal)"
The purpose of this code is to identify if the two
digits you input are equal or not.
"Activity 2 (Even or Odd)"
The purpose of this code is to identify if the digit
you input is even or odd.
"Activity 3 (Positive, Negative, Zero)"
The purpose of this code is to identify if the digit
you input is positive, negative, or zero.
"Activity 4 (Leap year or Not a leap year)"
The purpose of this code is to identify if the year
you input is a leap year or not a leap year.
"Activity 5 (Eligible to vote or not)"
The purpose of this code is to identify if the age
you input is eligible to vote or not. The age that
eligible to cast vote is 18 above.
"Activity 6 (Height Category)"
The purpose of this code is to accept height in
centimeters and categorized it from dwarf,
average height, and tall or abnormal height
based on the height you input.
"Activity 7 (The greatest number)"
The purpose of this code is to find the greatest
number among the three numbers you input and
then display it.
"Activity 8 (Temperature Identifier)"
The purpose of this code is to identify the
temperature you input according to the given
above.
"Activity 9 (Vowel or Consonant )"
The purpose of this code is to identify if the
alphabet you input is whether a vowel or
consonant.
"Activity 10 (Number to day format)"
The purpose of this code is to read day number
from 1 to 7 and then display the day name in
word format according to the given above.
"Activity 11 (Number to word format)"
The purpose of this code is to read digit from 1 to
9 and display it in word format according to the
given above.
"Activity 12 (Number to month format)"
The purpose of this code is to read month number
from 1 to 12 and displaying the month name on a word
format according to the given above.
"Menu Driven (Exam Output)"
The purpose of this code is to merge all 12 activities using an
else-if statement and prompt the user to choose from 1 to 12
exercises through a menu for convenient usage.
"Midterm Activity (Zodiac Sign Identifier)"
The purpose of this program is to identify your zodiac sign
based on the month and day you input. You can select a
number from the menu ranging from 1 to 12, and each
option corresponds to different zodiac signs based on
months.
" FLOWCHART AND ALGORITHM
FOR THE 12 EXERCISES "
"Activity 1 (Equal or Not Equal)"
"Activity 2 (Even or Odd)"
"Activity 3 (Positive, Negative, Zero)"
"Activity 4 (Leap year or Not a leap year)"
"Activity 5 (Eligible to vote or not)"
"Activity 6 (Height Category)"
"Activity 7 (The greatest number)"
"Activity 8 (Temperature Identifier)"
"Activity 9 (Vowel or Consonant )"
"Activity 10 (Number to day format)"
"Activity 11 (Number to word format)"
"Activity 12 (Number to month format)"
"Show and tell (My guessing game)"
The purpose of this programm is to entertain user by guessing a number from 1 to 100, 1 to
500,000 or 1 to 1 Million depending to the corresponding number that the user choose from
the menu. In menu it consist of 3 choice, 1 for guessing from 1 to 100, 2 for guessing from 1
to 500k and 3 for guessing from 1 to 1M. After you choose from the choices given, the user
must guess according to number range he or she choose then they can guess the right
number by the help of display (Too high! Try again or Too low! Try again), after many try
and errors you can now guess the right number and then it shows of how many attempts
after you get the right number. After that, the programm ask the user if he/she wants to
continue or not, if the user choose YES the program will loop to menu section but if the
user choose NO the program will stop.
"ALGORITHM AND FLOWCHART OF MY SHOW AND TELL "

Algorithm
Step 1: Start

Step 2: Display Loading screen and Welcome remarks

Step 3: Display menu

a. 1. choose number from (1-100)

b. 2. choose number from (1-500,000)

c. 3. choose number from (1- 1,000,000)

Step 4: Prompt the user to enter the number they choose:

a. if choose = 1, then the user Enter their guess from 1 to 100.

b. if choose = 2, then the user Enter their guess from 1 to 500,000.

c. if choose = 3, then the user Enter their guess from 1 to 1,000,000.

c. if choose = 4, display [INVALID INPUT] and end the program

Step 5: Evaluate their guess number if it is too low, too high, or guessed the correct number.

a. if guess < right guess number, display “Too low! Try again”then prompt the user to enter their guess
number again.

b. if guess > right guess number, display “Too high! Try again”then prompt the user to enter their guess
number again.

c. if guess = right guess number, display “Congratulations! You guessed the number in (depending on
how many attempts you guess the right number) attempts.

Step 6: Looping (prompt the user to ask if they want to play again by choosing 1 for Yes and 0 for No.

a. if choice = 1, the program must go back to step 4.

b. if choice = 0, then end the program.

c. if choice >=2, display [INVALID INPUT] and end the program.

Step 7: Stop

You might also like