0% found this document useful (0 votes)
76 views11 pages

FDGDFGD

Using PHP operators, HTML, and CSS, create a length conversion page that converts between meters and centimeters using a formula. Then, create a grade ranking program that outputs a student's grade and ranking (e.g. A-) using conditional statements. Finally, write a program using looping statements that outputs all potential two-digit decimal combinations in a comma delimited format.

Uploaded by

sean scott lee
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)
76 views11 pages

FDGDFGD

Using PHP operators, HTML, and CSS, create a length conversion page that converts between meters and centimeters using a formula. Then, create a grade ranking program that outputs a student's grade and ranking (e.g. A-) using conditional statements. Finally, write a program using looping statements that outputs all potential two-digit decimal combinations in a comma delimited format.

Uploaded by

sean scott lee
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/ 11

1.

Using PHP operators create a length conversion page, integrated with HTML and CSS (note:
use formula for each conversion) Example: 1 meter = 100 centimeter

Output
HTML:

PHP:
This is to convert the user input to its
meter value.

The second condition statement is to


convert the meter value to its
metric/empirical measurement value
which the user chose.
CSS:
2. Using conditional statement create a grade ranking program, integrated with HTML and CSS.
Example Grade = 92 Ranking: A-

OUTPUT:
IMAGES:
HTML:

PHP:
CSS:
3. Using Looping Statements write a program which will give you all of the potential
combinations of a two-digit decimal combination, printed in a comma delimited format

OUTPUT:

PHP:
VII. QUESTION AND ANSWER

1. What are the different Arithmetic operators used in the lab activity? describe each
I used the “ * “, “ / “, and “++”.
• Multiplication Arithmetic Operator (*)
- it is used to get the product of two numbers.

• Division Arithmetic Operator (/)


- it is used to get the quotient of two numbers.

• Increment Arithmetic Operator (++)


- it is used to increment a number. It usually used in for loop to iterate the statement/s.

2. Can you apply formula in webpages? Give an example

Yes, you can apply formula in webpages using PHP. In this activity, formula for converting
measurements is used. One of the formula used in this activity is “$meterVal = $userinput*0.001;”.
This formula is used to convert millimeter t to its equivalent meter value.

2. What are the different conditional statements? Describe each


There are switch and if-else statement.
• Switch statement is used to select one of many blocks of code to be executed.
• The if-else statement executes some code if a condition is true and another code if that
condition is false.
3. Can you create a condition inside of a condition?
Yes, this is called nested if-else. You can add a conditional statement inside a condition
4. Do you think these conditional statements is important in the program? Then why?
Yes, conditional statements are very important because you can set different approach in
different scenario. The program can respond differently depending to the user input. This is only
possible because of the conditional statements.
5. What are the different looping statements in PHP? Describe each
• while - loops through a block of code as long as the specified condition is true
• do...while - loops through a block of code once, and then repeats the loop as long as the
specified condition is true
• for - loops through a block of code a specified number of times
• foreach - loops through a block of code for each element in an array
6. What is the importance of looping?
Loop is very important in lessening the code because using loop you can run a statement
multiple times.

You might also like