do these php tasks in different php files but add a home page to call them (index.php). use tailwindcss (using cdn) and google fonts: cairo play and sharetech mono. make the UI dark and as minimalist as possible. Use macOS-inspired assets like buttons and images:
Browse files1. Introduce Yourself
Task: Create variables for your name, age, and favorite color. Print them in a sentence (e.g., “Hi, I’m John, I am 20 years old, and my favorite color is blue.”).
2. Simple Math
Task: Store two numbers in variables `$a` and `$b`. Compute and display their sum, difference, product, and quotient.
3. Area and Perimeter of a Rectangle
Task: Use variables `$length` and `$width`. Calculate and display the area and perimeter.
4. Temperature Converter
Task: Store a Celsius temperature in a variable and convert it to Fahrenheit using the formula.
5. Swapping Variables
Task: Assign values to two variables and swap them without directly reassigning values*(use a temporary variable).
6. Salary Calculator
Task: Store `basic_salary`, `allowance`, and `deduction` in variables. Compute and display the net salary.
7. BMI Calculator
Task: Store `weight` (kg) and `height` (m) in variables. Compute BMI using the formula `BMI = weight / (height height)`. Display the result.
8. String Manipulation
Task: Store a sentence in a variable. Display:
number of characters (`strlen`)
number of words (`str_word_count`)
the sentence in uppercase and lowercase.
9. Bank Account Simulation
Task: Create variables for `balance`, `deposit`, and `withdraw`. Update the balance based on transactions and display the result.
10. Simple Grading System
Task: Store scores for Math, English, and Science in variables. Compute the average and display the grade based on conditions (e.g., >=90 = A, >=80 = B, etc.).
11. Currency Converter
Task: Store an amount in PHP and convert it to USD, EUR, or JPY using variables for exchange rates.
12. Travel Cost Estimator
Task: Use variables for `distance`, `fuel_consumption` (km per liter), and `fuel_price`. Compute and display the estimated travel cost.
- bank.php +47 -0
- bmi.php +42 -0
- currency.php +48 -0
- grades.php +58 -0
- index.php +43 -40
- introduce.php +14 -25
- math.php +26 -134
- rectangle.php +43 -0
- salary.php +44 -0
- string.php +42 -0
- swap.php +45 -0
- temperature.php +40 -0
- travel.php +47 -0
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Bank Account</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Bank Account Simulation</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$balance = 10000;
|
| 30 |
+
$deposit = 5000;
|
| 31 |
+
$withdraw = 3000;
|
| 32 |
+
|
| 33 |
+
echo "<div class='space-y-4'>";
|
| 34 |
+
echo "<p class='text-lg'>Initial Balance: $balance</p>";
|
| 35 |
+
echo "<p class='text-lg'>Deposit: +$deposit</p>";
|
| 36 |
+
echo "<p class='text-lg'>Withdraw: -$withdraw</p>";
|
| 37 |
+
|
| 38 |
+
$balance += $deposit;
|
| 39 |
+
$balance -= $withdraw;
|
| 40 |
+
|
| 41 |
+
echo "<p class='text-lg font-semibold text-blue-400'>Final Balance: $balance</p>";
|
| 42 |
+
echo "</div>";
|
| 43 |
+
?>
|
| 44 |
+
</div>
|
| 45 |
+
</div>
|
| 46 |
+
</body>
|
| 47 |
+
</html>
|
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>BMI Calculator</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">BMI Calculator</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$weight = 70; // kg
|
| 30 |
+
$height = 1.75; // m
|
| 31 |
+
$bmi = $weight / ($height * $height);
|
| 32 |
+
|
| 33 |
+
echo "<div class='space-y-4'>";
|
| 34 |
+
echo "<p class='text-lg'>Weight: $weight kg</p>";
|
| 35 |
+
echo "<p class='text-lg'>Height: $height m</p>";
|
| 36 |
+
echo "<p class='text-lg font-semibold text-blue-400'>BMI: " . number_format($bmi, 2) . "</p>";
|
| 37 |
+
echo "</div>";
|
| 38 |
+
?>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
| 41 |
+
</body>
|
| 42 |
+
</html>
|
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Currency Converter</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Currency Converter</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$php_amount = 1000;
|
| 30 |
+
$usd_rate = 0.018;
|
| 31 |
+
$eur_rate = 0.017;
|
| 32 |
+
$jpy_rate = 2.42;
|
| 33 |
+
|
| 34 |
+
$usd = $php_amount * $usd_rate;
|
| 35 |
+
$eur = $php_amount * $eur_rate;
|
| 36 |
+
$jpy = $php_amount * $jpy_rate;
|
| 37 |
+
|
| 38 |
+
echo "<div class='space-y-4'>";
|
| 39 |
+
echo "<p class='text-lg'>PHP Amount: $php_amount</p>";
|
| 40 |
+
echo "<p class='text-lg'>USD: " . number_format($usd, 2) . "</p>";
|
| 41 |
+
echo "<p class='text-lg'>EUR: " . number_format($eur, 2) . "</p>";
|
| 42 |
+
echo "<p class='text-lg'>JPY: " . number_format($jpy, 2) . "</p>";
|
| 43 |
+
echo "</div>";
|
| 44 |
+
?>
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
</body>
|
| 48 |
+
</html>
|
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Grading System</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Grading System</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$math = 85;
|
| 30 |
+
$english = 92;
|
| 31 |
+
$science = 78;
|
| 32 |
+
$average = ($math + $english + $science) / 3;
|
| 33 |
+
|
| 34 |
+
$grade = '';
|
| 35 |
+
if ($average >= 90) {
|
| 36 |
+
$grade = 'A';
|
| 37 |
+
} elseif ($average >= 80) {
|
| 38 |
+
$grade = 'B';
|
| 39 |
+
} elseif ($average >= 70) {
|
| 40 |
+
$grade = 'C';
|
| 41 |
+
} elseif ($average >= 60) {
|
| 42 |
+
$grade = 'D';
|
| 43 |
+
} else {
|
| 44 |
+
$grade = 'F';
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
echo "<div class='space-y-4'>";
|
| 48 |
+
echo "<p class='text-lg'>Math: $math</p>";
|
| 49 |
+
echo "<p class='text-lg'>English: $english</p>";
|
| 50 |
+
echo "<p class='text-lg'>Science: $science</p>";
|
| 51 |
+
echo "<p class='text-lg'>Average: " . number_format($average, 2) . "</p>";
|
| 52 |
+
echo "<p class='text-lg font-semibold text-blue-400'>Grade: $grade</p>";
|
| 53 |
+
echo "</div>";
|
| 54 |
+
?>
|
| 55 |
+
</div>
|
| 56 |
+
</div>
|
| 57 |
+
</body>
|
| 58 |
+
</html>
|
|
@@ -9,8 +9,8 @@
|
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
font-family: 'Cairo Play', sans-serif;
|
| 12 |
-
background-color: #
|
| 13 |
-
color: #
|
| 14 |
}
|
| 15 |
.mono {
|
| 16 |
font-family: 'Share Tech Mono', monospace;
|
|
@@ -19,67 +19,70 @@
|
|
| 19 |
</head>
|
| 20 |
<body class="min-h-screen p-8">
|
| 21 |
<div class="max-w-4xl mx-auto">
|
| 22 |
-
<
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
| 24 |
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 25 |
-
<a href="introduce.php" class="bg-
|
| 26 |
-
<h2 class="text-xl font-semibold mb-2
|
| 27 |
-
<p class="text-
|
| 28 |
</a>
|
| 29 |
|
| 30 |
-
<a href="math.php" class="bg-
|
| 31 |
-
<h2 class="text-xl font-semibold mb-2
|
| 32 |
-
<p class="text-
|
| 33 |
</a>
|
| 34 |
|
| 35 |
-
<a href="rectangle.php" class="bg-
|
| 36 |
-
<h2 class="text-xl font-semibold mb-2
|
| 37 |
-
<p class="text-
|
| 38 |
</a>
|
| 39 |
|
| 40 |
-
<a href="temperature.php" class="bg-
|
| 41 |
-
<h2 class="text-xl font-semibold mb-2
|
| 42 |
-
<p class="text-
|
| 43 |
</a>
|
| 44 |
|
| 45 |
-
<a href="swap.php" class="bg-
|
| 46 |
-
<h2 class="text-xl font-semibold mb-2
|
| 47 |
-
<p class="text-
|
| 48 |
</a>
|
| 49 |
|
| 50 |
-
<a href="salary.php" class="bg-
|
| 51 |
-
<h2 class="text-xl font-semibold mb-2
|
| 52 |
-
<p class="text-
|
| 53 |
</a>
|
| 54 |
|
| 55 |
-
<a href="bmi.php" class="bg-
|
| 56 |
-
<h2 class="text-xl font-semibold mb-2
|
| 57 |
-
<p class="text-
|
| 58 |
</a>
|
| 59 |
|
| 60 |
-
<a href="string.php" class="bg-
|
| 61 |
-
<h2 class="text-xl font-semibold mb-2
|
| 62 |
-
<p class="text-
|
| 63 |
</a>
|
| 64 |
|
| 65 |
-
<a href="bank.php" class="bg-
|
| 66 |
-
<h2 class="text-xl font-semibold mb-2
|
| 67 |
-
<p class="text-
|
| 68 |
</a>
|
| 69 |
|
| 70 |
-
<a href="grades.php" class="bg-
|
| 71 |
-
<h2 class="text-xl font-semibold mb-2
|
| 72 |
-
<p class="text-
|
| 73 |
</a>
|
| 74 |
|
| 75 |
-
<a href="currency.php" class="bg-
|
| 76 |
-
<h2 class="text-xl font-semibold mb-2
|
| 77 |
-
<p class="text-
|
| 78 |
</a>
|
| 79 |
|
| 80 |
-
<a href="travel.php" class="bg-
|
| 81 |
-
<h2 class="text-xl font-semibold mb-2
|
| 82 |
-
<p class="text-
|
| 83 |
</a>
|
| 84 |
</div>
|
| 85 |
</div>
|
|
|
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
}
|
| 15 |
.mono {
|
| 16 |
font-family: 'Share Tech Mono', monospace;
|
|
|
|
| 19 |
</head>
|
| 20 |
<body class="min-h-screen p-8">
|
| 21 |
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12 text-center">
|
| 23 |
+
<h1 class="text-4xl font-bold mb-2">PHP Tasks</h1>
|
| 24 |
+
<p class="text-gray-400">Select a task to execute</p>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
| 28 |
+
<a href="introduce.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 29 |
+
<h2 class="text-xl font-semibold mb-2">1. Introduce Yourself</h2>
|
| 30 |
+
<p class="text-gray-400">Basic variable usage</p>
|
| 31 |
</a>
|
| 32 |
|
| 33 |
+
<a href="math.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 34 |
+
<h2 class="text-xl font-semibold mb-2">2. Simple Math</h2>
|
| 35 |
+
<p class="text-gray-400">Basic arithmetic operations</p>
|
| 36 |
</a>
|
| 37 |
|
| 38 |
+
<a href="rectangle.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 39 |
+
<h2 class="text-xl font-semibold mb-2">3. Rectangle Calculations</h2>
|
| 40 |
+
<p class="text-gray-400">Area and perimeter</p>
|
| 41 |
</a>
|
| 42 |
|
| 43 |
+
<a href="temperature.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 44 |
+
<h2 class="text-xl font-semibold mb-2">4. Temperature Converter</h2>
|
| 45 |
+
<p class="text-gray-400">Celsius to Fahrenheit</p>
|
| 46 |
</a>
|
| 47 |
|
| 48 |
+
<a href="swap.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 49 |
+
<h2 class="text-xl font-semibold mb-2">5. Swapping Variables</h2>
|
| 50 |
+
<p class="text-gray-400">Using temporary variable</p>
|
| 51 |
</a>
|
| 52 |
|
| 53 |
+
<a href="salary.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 54 |
+
<h2 class="text-xl font-semibold mb-2">6. Salary Calculator</h2>
|
| 55 |
+
<p class="text-gray-400">Net salary calculation</p>
|
| 56 |
</a>
|
| 57 |
|
| 58 |
+
<a href="bmi.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 59 |
+
<h2 class="text-xl font-semibold mb-2">7. BMI Calculator</h2>
|
| 60 |
+
<p class="text-gray-400">Body Mass Index</p>
|
| 61 |
</a>
|
| 62 |
|
| 63 |
+
<a href="string.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 64 |
+
<h2 class="text-xl font-semibold mb-2">8. String Manipulation</h2>
|
| 65 |
+
<p class="text-gray-400">Text processing</p>
|
| 66 |
</a>
|
| 67 |
|
| 68 |
+
<a href="bank.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 69 |
+
<h2 class="text-xl font-semibold mb-2">9. Bank Account</h2>
|
| 70 |
+
<p class="text-gray-400">Balance simulation</p>
|
| 71 |
</a>
|
| 72 |
|
| 73 |
+
<a href="grades.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 74 |
+
<h2 class="text-xl font-semibold mb-2">10. Grading System</h2>
|
| 75 |
+
<p class="text-gray-400">Score evaluation</p>
|
| 76 |
</a>
|
| 77 |
|
| 78 |
+
<a href="currency.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 79 |
+
<h2 class="text-xl font-semibold mb-2">11. Currency Converter</h2>
|
| 80 |
+
<p class="text-gray-400">PHP to other currencies</p>
|
| 81 |
</a>
|
| 82 |
|
| 83 |
+
<a href="travel.php" class="bg-gray-800 hover:bg-gray-700 transition p-6 rounded-lg shadow-md">
|
| 84 |
+
<h2 class="text-xl font-semibold mb-2">12. Travel Cost</h2>
|
| 85 |
+
<p class="text-gray-400">Fuel cost estimation</p>
|
| 86 |
</a>
|
| 87 |
</div>
|
| 88 |
</div>
|
|
@@ -9,8 +9,8 @@
|
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
font-family: 'Cairo Play', sans-serif;
|
| 12 |
-
background-color: #
|
| 13 |
-
color: #
|
| 14 |
}
|
| 15 |
.mono {
|
| 16 |
font-family: 'Share Tech Mono', monospace;
|
|
@@ -18,30 +18,19 @@
|
|
| 18 |
</style>
|
| 19 |
</head>
|
| 20 |
<body class="min-h-screen p-8">
|
| 21 |
-
<div class="max-w-
|
| 22 |
-
<
|
| 23 |
-
<
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
<
|
| 28 |
-
|
| 29 |
-
<h1 class="text-3xl font-bold mb-6 text-blue-400">Introduce Yourself</h1>
|
| 30 |
-
|
| 31 |
-
<div class="bg-slate-800 rounded-lg p-6 shadow-lg border border-slate-700">
|
| 32 |
<?php
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
echo "<div class='mt-6 p-4 bg-slate-900 rounded-lg mono'>";
|
| 40 |
-
echo "<code>\$name = \"Alex\";</code><br>";
|
| 41 |
-
echo "<code>\$age = 28;</code><br>";
|
| 42 |
-
echo "<code>\$favoriteColor = \"blue\";</code><br><br>";
|
| 43 |
-
echo "<code>echo \"Hi, I'm \$name, I am \$age years old, and my favorite color is \$favoriteColor.\";</code>";
|
| 44 |
-
echo "</div>";
|
| 45 |
?>
|
| 46 |
</div>
|
| 47 |
</div>
|
|
|
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
}
|
| 15 |
.mono {
|
| 16 |
font-family: 'Share Tech Mono', monospace;
|
|
|
|
| 18 |
</style>
|
| 19 |
</head>
|
| 20 |
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Introduce Yourself</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
<?php
|
| 29 |
+
$name = "Alex";
|
| 30 |
+
$age = 28;
|
| 31 |
+
$favoriteColor = "blue";
|
| 32 |
+
|
| 33 |
+
echo "<p class='text-lg'>Hi, I'm $name, I am $age years old, and my favorite color is $favoriteColor.</p>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
?>
|
| 35 |
</div>
|
| 36 |
</div>
|
|
@@ -4,148 +4,40 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Simple Math</title>
|
| 7 |
-
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
|
|
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
-
font-family: '
|
| 12 |
-
background-color: #
|
| 13 |
-
color: #
|
| 14 |
}
|
| 15 |
-
.
|
| 16 |
-
|
| 17 |
-
border-radius: 12px;
|
| 18 |
-
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
|
| 19 |
-
border: 1px solid #333;
|
| 20 |
-
max-width: 600px;
|
| 21 |
-
margin: 2rem auto;
|
| 22 |
-
}
|
| 23 |
-
.window-header {
|
| 24 |
-
background: linear-gradient(to bottom, #2d2d2d, #252525);
|
| 25 |
-
border-top-left-radius: 12px;
|
| 26 |
-
border-top-right-radius: 12px;
|
| 27 |
-
padding: 8px 12px;
|
| 28 |
-
border-bottom: 1px solid #333;
|
| 29 |
-
}
|
| 30 |
-
.operation-icon {
|
| 31 |
-
width: 32px;
|
| 32 |
-
height: 32px;
|
| 33 |
-
background-color: #333;
|
| 34 |
-
border-radius: 6px;
|
| 35 |
-
display: flex;
|
| 36 |
-
align-items: center;
|
| 37 |
-
justify-content: center;
|
| 38 |
}
|
| 39 |
</style>
|
| 40 |
</head>
|
| 41 |
-
<body>
|
| 42 |
-
<div class="
|
| 43 |
-
<
|
| 44 |
-
<
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
<
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
<div class="p-6">
|
| 54 |
-
<h1 class="text-xl font-bold mb-4" style="font-family: 'Cairo Play', sans-serif;">Basic Arithmetic</h1>
|
| 55 |
-
|
| 56 |
-
<div class="grid grid-cols-2 gap-4 mb-6">
|
| 57 |
-
<div class="bg-gray-800 rounded-lg p-4">
|
| 58 |
-
<div class="flex items-center mb-2">
|
| 59 |
-
<div class="operation-icon mr-2">
|
| 60 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 61 |
-
<line x1="5" y1="12" x2="19" y2="12"></line>
|
| 62 |
-
<line x1="12" y1="5" x2="12" y2="19"></line>
|
| 63 |
-
</svg>
|
| 64 |
-
</div>
|
| 65 |
-
<div>
|
| 66 |
-
<h3 class="font-medium">Addition</h3>
|
| 67 |
-
</div>
|
| 68 |
-
</div>
|
| 69 |
-
<p class="text-gray-300"><?php echo "$a + $b = $sum"; ?></p>
|
| 70 |
-
</div>
|
| 71 |
-
|
| 72 |
-
<div class="bg-gray-800 rounded-lg p-4">
|
| 73 |
-
<div class="flex items-center mb-2">
|
| 74 |
-
<div class="operation-icon mr-2">
|
| 75 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 76 |
-
<line x1="5" y1="12" x2="19" y2="12"></line>
|
| 77 |
-
</svg>
|
| 78 |
-
</div>
|
| 79 |
-
<div>
|
| 80 |
-
<h3 class="font-medium">Subtraction</h3>
|
| 81 |
-
</div>
|
| 82 |
-
</div>
|
| 83 |
-
<p class="text-gray-300"><?php echo "$a - $b = $difference"; ?></p>
|
| 84 |
-
</div>
|
| 85 |
-
|
| 86 |
-
<div class="bg-gray-800 rounded-lg p-4">
|
| 87 |
-
<div class="flex items-center mb-2">
|
| 88 |
-
<div class="operation-icon mr-2">
|
| 89 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
| 90 |
-
<line x1="4" y1="12" x2="20" y2="12"></line>
|
| 91 |
-
<line x1="12" y1="4" x2="12" y2="20"></line>
|
| 92 |
-
</svg>
|
| 93 |
-
</div>
|
| 94 |
-
<div>
|
| 95 |
-
<h3 class="font-medium">Multiplication</h3>
|
| 96 |
-
</div>
|
| 97 |
-
</div>
|
| 98 |
-
<p class="text-gray-300"><?php echo "$a × $b = $product"; ?></p>
|
| 99 |
-
</div>
|
| 100 |
|
| 101 |
-
<div class=
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
</div>
|
| 110 |
-
<div>
|
| 111 |
-
<h3 class="font-medium">Division</h3>
|
| 112 |
-
</div>
|
| 113 |
-
</div>
|
| 114 |
-
<p class="text-gray-300"><?php echo "$a ÷ $b = " . number_format($quotient, 2); ?></p>
|
| 115 |
-
</div>
|
| 116 |
-
</div>
|
| 117 |
-
|
| 118 |
-
<div class="bg-gray-800 rounded-lg p-4 mb-6">
|
| 119 |
-
<h3 class="font-medium mb-2">Variables Used</h3>
|
| 120 |
-
<div class="grid grid-cols-3 gap-2 text-sm">
|
| 121 |
-
<div class="bg-gray-700 p-2 rounded">
|
| 122 |
-
<div class="text-gray-400">a</div>
|
| 123 |
-
<div><?php echo $a; ?></div>
|
| 124 |
-
</div>
|
| 125 |
-
<div class="bg-gray-700 p-2 rounded">
|
| 126 |
-
<div class="text-gray-400">b</div>
|
| 127 |
-
<div><?php echo $b; ?></div>
|
| 128 |
-
</div>
|
| 129 |
-
<div class="bg-gray-700 p-2 rounded">
|
| 130 |
-
<div class="text-gray-400">Type</div>
|
| 131 |
-
<div>Integer</div>
|
| 132 |
-
</div>
|
| 133 |
-
</div>
|
| 134 |
-
</div>
|
| 135 |
-
|
| 136 |
-
<div class="flex justify-between items-center border-t border-gray-700 pt-4">
|
| 137 |
-
<a href="index.php" class="text-blue-400 hover:text-blue-300 text-sm flex items-center">
|
| 138 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="mr-1">
|
| 139 |
-
<polyline points="15 18 9 12 15 6"></polyline>
|
| 140 |
-
</svg>
|
| 141 |
-
Back to Tasks
|
| 142 |
-
</a>
|
| 143 |
-
<div class="text-xs text-gray-500">Task 2 of 12</div>
|
| 144 |
-
</div>
|
| 145 |
</div>
|
| 146 |
</div>
|
| 147 |
</body>
|
| 148 |
-
</html>
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
[Additional PHP files for the remaining tasks would follow the same pattern with appropriate UI for each task...]
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Simple Math</title>
|
|
|
|
| 7 |
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
}
|
| 18 |
</style>
|
| 19 |
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Simple Math</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$a = 15;
|
| 30 |
+
$b = 3;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
echo "<div class='space-y-4'>";
|
| 33 |
+
echo "<p class='text-lg'>Numbers: $a and $b</p>";
|
| 34 |
+
echo "<p class='text-lg'>Sum: " . ($a + $b) . "</p>";
|
| 35 |
+
echo "<p class='text-lg'>Difference: " . ($a - $b) . "</p>";
|
| 36 |
+
echo "<p class='text-lg'>Product: " . ($a * $b) . "</p>";
|
| 37 |
+
echo "<p class='text-lg'>Quotient: " . ($a / $b) . "</p>";
|
| 38 |
+
echo "</div>";
|
| 39 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
</div>
|
| 41 |
</div>
|
| 42 |
</body>
|
| 43 |
+
</html>
|
|
|
|
|
|
|
|
|
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Rectangle Calculations</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Rectangle Calculations</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$length = 10;
|
| 30 |
+
$width = 5;
|
| 31 |
+
$area = $length * $width;
|
| 32 |
+
$perimeter = 2 * ($length + $width);
|
| 33 |
+
|
| 34 |
+
echo "<div class='space-y-4'>";
|
| 35 |
+
echo "<p class='text-lg'>Rectangle dimensions: $length (length) × $width (width)</p>";
|
| 36 |
+
echo "<p class='text-lg'>Area: $area</p>";
|
| 37 |
+
echo "<p class='text-lg'>Perimeter: $perimeter</p>";
|
| 38 |
+
echo "</div>";
|
| 39 |
+
?>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
</body>
|
| 43 |
+
</html>
|
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Salary Calculator</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Salary Calculator</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$basic_salary = 50000;
|
| 30 |
+
$allowance = 15000;
|
| 31 |
+
$deduction = 7500;
|
| 32 |
+
$net_salary = $basic_salary + $allowance - $deduction;
|
| 33 |
+
|
| 34 |
+
echo "<div class='space-y-4'>";
|
| 35 |
+
echo "<p class='text-lg'>Basic Salary: $basic_salary</p>";
|
| 36 |
+
echo "<p class='text-lg'>Allowance: $allowance</p>";
|
| 37 |
+
echo "<p class='text-lg'>Deduction: $deduction</p>";
|
| 38 |
+
echo "<p class='text-lg font-semibold text-blue-400'>Net Salary: $net_salary</p>";
|
| 39 |
+
echo "</div>";
|
| 40 |
+
?>
|
| 41 |
+
</div>
|
| 42 |
+
</div>
|
| 43 |
+
</body>
|
| 44 |
+
</html>
|
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>String Manipulation</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">String Manipulation</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$sentence = "The quick brown fox jumps over the lazy dog";
|
| 30 |
+
|
| 31 |
+
echo "<div class='space-y-4'>";
|
| 32 |
+
echo "<p class='text-lg'>Original: $sentence</p>";
|
| 33 |
+
echo "<p class='text-lg'>Character count: " . strlen($sentence) . "</p>";
|
| 34 |
+
echo "<p class='text-lg'>Word count: " . str_word_count($sentence) . "</p>";
|
| 35 |
+
echo "<p class='text-lg'>Uppercase: " . strtoupper($sentence) . "</p>";
|
| 36 |
+
echo "<p class='text-lg'>Lowercase: " . strtolower($sentence) . "</p>";
|
| 37 |
+
echo "</div>";
|
| 38 |
+
?>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
| 41 |
+
</body>
|
| 42 |
+
</html>
|
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Swapping Variables</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Swapping Variables</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$a = 10;
|
| 30 |
+
$b = 20;
|
| 31 |
+
|
| 32 |
+
echo "<div class='space-y-4'>";
|
| 33 |
+
echo "<p class='text-lg'>Before swap: a = $a, b = $b</p>";
|
| 34 |
+
|
| 35 |
+
$temp = $a;
|
| 36 |
+
$a = $b;
|
| 37 |
+
$b = $temp;
|
| 38 |
+
|
| 39 |
+
echo "<p class='text-lg'>After swap: a = $a, b = $b</p>";
|
| 40 |
+
echo "</div>";
|
| 41 |
+
?>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
</body>
|
| 45 |
+
</html>
|
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Temperature Converter</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Temperature Converter</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$celsius = 25;
|
| 30 |
+
$fahrenheit = ($celsius * 9/5) + 32;
|
| 31 |
+
|
| 32 |
+
echo "<div class='space-y-4'>";
|
| 33 |
+
echo "<p class='text-lg'>Celsius: $celsius °C</p>";
|
| 34 |
+
echo "<p class='text-lg'>Fahrenheit: $fahrenheit °F</p>";
|
| 35 |
+
echo "</div>";
|
| 36 |
+
?>
|
| 37 |
+
</div>
|
| 38 |
+
</div>
|
| 39 |
+
</body>
|
| 40 |
+
</html>
|
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Travel Cost Estimator</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Cairo+Play:wght@400;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<style>
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Cairo Play', sans-serif;
|
| 12 |
+
background-color: #1a1a1a;
|
| 13 |
+
color: #e5e7eb;
|
| 14 |
+
}
|
| 15 |
+
.mono {
|
| 16 |
+
font-family: 'Share Tech Mono', monospace;
|
| 17 |
+
}
|
| 18 |
+
</style>
|
| 19 |
+
</head>
|
| 20 |
+
<body class="min-h-screen p-8">
|
| 21 |
+
<div class="max-w-4xl mx-auto">
|
| 22 |
+
<header class="mb-12">
|
| 23 |
+
<h1 class="text-3xl font-bold mb-2">Travel Cost Estimator</h1>
|
| 24 |
+
<a href="index.php" class="text-blue-400 hover:text-blue-300">← Back to tasks</a>
|
| 25 |
+
</header>
|
| 26 |
+
|
| 27 |
+
<div class="bg-gray-800 p-6 rounded-lg shadow-md">
|
| 28 |
+
<?php
|
| 29 |
+
$distance = 350; // km
|
| 30 |
+
$fuel_consumption = 12; // km per liter
|
| 31 |
+
$fuel_price = 55; // per liter
|
| 32 |
+
|
| 33 |
+
$liters_needed = $distance / $fuel_consumption;
|
| 34 |
+
$total_cost = $liters_needed * $fuel_price;
|
| 35 |
+
|
| 36 |
+
echo "<div class='space-y-4'>";
|
| 37 |
+
echo "<p class='text-lg'>Distance: $distance km</p>";
|
| 38 |
+
echo "<p class='text-lg'>Fuel Consumption: $fuel_consumption km/L</p>";
|
| 39 |
+
echo "<p class='text-lg'>Fuel Price: $fuel_price per liter</p>";
|
| 40 |
+
echo "<p class='text-lg'>Fuel Needed: " . number_format($liters_needed, 2) . " L</p>";
|
| 41 |
+
echo "<p class='text-lg font-semibold text-blue-400'>Total Cost: " . number_format($total_cost, 2) . "</p>";
|
| 42 |
+
echo "</div>";
|
| 43 |
+
?>
|
| 44 |
+
</div>
|
| 45 |
+
</div>
|
| 46 |
+
</body>
|
| 47 |
+
</html>
|