0% found this document useful (0 votes)
3 views

Code

The document contains programming exercises submitted by students in a BSIT II-A class, focusing on PHP coding. Each exercise includes HTML structure and PHP scripts for basic calculations, conditional statements, and output formatting. The exercises demonstrate students' understanding of programming concepts such as multiplication, comparisons, and time-based greetings.

Uploaded by

kentbaguio2234
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Code

The document contains programming exercises submitted by students in a BSIT II-A class, focusing on PHP coding. Each exercise includes HTML structure and PHP scripts for basic calculations, conditional statements, and output formatting. The exercises demonstrate students' understanding of programming concepts such as multiplication, comparisons, and time-based greetings.

Uploaded by

kentbaguio2234
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Name: Kent RG A. Baguio​ ​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​ ​ ​ ​ ​

Exercise #2

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon"
href="384550380_252097501182187_1267731472058973915_n.png">
<title>Exercise 2</title>

</head>
<body>
<h1>Calculation</h1>
<?php
$num1=10;
$num2=5;
$sum=$num1 * $num2;

echo "The product:\t".$num1."and:\t".$num2."is:\t".$num1*$num2;

?>
</body>
</html>

Name: Kent RG A. Baguio​ ​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​

Exercise #3
​ ​ ​ ​

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=\, initial-scale=1.0">
<title>Excercise 3</title>
</head>
<body>
<?php
$a =50;
$b = 10;

if ($a > $b){


echo "Hello ,I enjoy PHP programming ";
}else{
echo "No, I don't enjoy it";
}

?>

</body>
</html>

Name: Khen D. Sorela​ ​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​ ​

Exercise #2

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>

<?php
$num1 = 10;
$num2 = 5;
$result = $num1 * $num2;

echo "<p>Problem: " . $num1 . " * " . $num2;


echo "<p>Result: " . $result;
?>

</body>
</html>

Name: Khen D. Sorela​ ​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​ ​

Exercise #3

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$t = date("H");

if ($t < "10") {


echo "Have a good morning enjoy programming!";
} else if ($t < "20") {
echo "Have a good day!";
} else {
echo "Have a good night!";
}
?>
</body>
</html>

Name: Arlon N. Rondina​ ​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​ ​

Exercise #2

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>

<?php
$num1 = 10;
$num2 = 5;
$result = $num1 * $num2;

echo "<p>Problem: " . $num1 . " * " . $num2;


echo "<p>Result: " . $result;
?>

</body>
</html>

Name: Arlon N. Rondina​ ​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​ ​

Exercise #3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$t = date("H");

if ($t < "10") {


echo "Have a good morning enjoy programming!";
} else if ($t < "20") {
echo "Have a good day!";
} else {
echo "Have a good night!";
}
?>
</body>
</html>

Name: Vera Angeline A. Perater​ ​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​ ​

Exercise #2

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ACTIVITY 2</title>
</head>
<body>
<?php
$num1 = 10;
$num2 = 5;

$result = $num1 * $num2 ;


echo ("Output:" .$num1. "x" .$num2. "=" .$result);
?>
</body>
</html>

Name: Vera Angeline A. Perater​ ​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​ ​

Exercise #3

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ACTIVITY 3</title>
</head>
<body>
<?php
$a = 50;
$b = 10;

if ($a > $b){


echo "Hello for enjoy PHP programming!";
}
?>
</body>
</html>

Name: Lawrence S. Ramirez​​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​ ​

Exercise #2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php

// Introduction
$greetings = "<h2>Good day! This is my first programming script.</h2>";
echo ($greetings);

// Multiply 10 with 5, and output the result.


echo("<h2>Calculations using PHP syntax</h2>");
$num1 = 10;
$num2 = 5;

$result1 = $num1 * $num2;


echo("The result of " .$num1. " x " .$num2. " is " .$result1. ".<br>");

// Additional code for addition, subtraction, and division


$result2 = $num1 + $num2;
echo("The result of " .$num1. " + " .$num2. " is " .$result2. ".<br>");

$result3 = $num1 - $num2;


echo("The result of " .$num1. " - " .$num2. " is " .$result3. ".<br>");

if ($num2 == 0) {
echo("Division by zero is not valid!");
} else {
$result4 = $num1 - $num2;
echo("The result of " .$num1. " / " .$num2. " is " .$result3. ".<br><br>");
}

// The name of the one who made the exercise


echo("<hr>");
$name = "Lawrence S. Ramirez";
$section = "BSIT II-A";

echo("This output is submitted by <h2>" .$name. "</h2> from section <h2>" .$section. "</h2>.")

?>
</body>
</html>

Name: Lawrence S. Ramirez​​ ​ ​ ​ ​ ​ BSIT II-A​


Subject: Integrative programming​ ​

Exercise #3

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
// Output "Hello for enjoy PHP programming!" if $a is greater than $b.
$a = 50;
$b = 10;
$introduction = "Variables use are " .$a. " and " .$b. ".";

if ($a > $b) {


echo("<h2>I enjoy PHP programming!</h2>");
echo($introduction. "<br>");
echo($a. " is greater than " .$b. ".");
} else {
echo("<h2>I don't enjoy PHP programming</h2>!");
echo($introduction . "<br>");
echo($a. " is lesser than " .$b. ".");
}

// The name of the one who made the exercise


echo("<hr>");
$name = "Lawrence S. Ramirez";
$section = "BSIT II-A";
0
echo("This output is submitted by <h2>" .$name. "</h2> from section <h2>" .$section.
"</h2>.")

?>
</body>
</html>

96

You might also like