ctrlplus-zai commited on
Commit
08c6da7
·
verified ·
1 Parent(s): 10c7c2d

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 files

1. 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.

Files changed (13) hide show
  1. bank.php +47 -0
  2. bmi.php +42 -0
  3. currency.php +48 -0
  4. grades.php +58 -0
  5. index.php +43 -40
  6. introduce.php +14 -25
  7. math.php +26 -134
  8. rectangle.php +43 -0
  9. salary.php +44 -0
  10. string.php +42 -0
  11. swap.php +45 -0
  12. temperature.php +40 -0
  13. travel.php +47 -0
bank.php ADDED
@@ -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>
bmi.php ADDED
@@ -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>
currency.php ADDED
@@ -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>
grades.php ADDED
@@ -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>
index.php CHANGED
@@ -9,8 +9,8 @@
9
  <style>
10
  body {
11
  font-family: 'Cairo Play', sans-serif;
12
- background-color: #0f172a;
13
- color: #e2e8f0;
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
- <h1 class="text-4xl font-bold mb-8 text-center text-blue-400">PHP Tasks</h1>
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-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
26
- <h2 class="text-xl font-semibold mb-2 text-blue-300">1. Introduce Yourself</h2>
27
- <p class="text-slate-300">Variables for name, age, and favorite color.</p>
28
  </a>
29
 
30
- <a href="math.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
31
- <h2 class="text-xl font-semibold mb-2 text-blue-300">2. Simple Math</h2>
32
- <p class="text-slate-300">Sum, difference, product, and quotient.</p>
33
  </a>
34
 
35
- <a href="rectangle.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
36
- <h2 class="text-xl font-semibold mb-2 text-blue-300">3. Rectangle</h2>
37
- <p class="text-slate-300">Area and perimeter of a rectangle.</p>
38
  </a>
39
 
40
- <a href="temperature.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
41
- <h2 class="text-xl font-semibold mb-2 text-blue-300">4. Temperature</h2>
42
- <p class="text-slate-300">Convert Celsius to Fahrenheit.</p>
43
  </a>
44
 
45
- <a href="swap.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
46
- <h2 class="text-xl font-semibold mb-2 text-blue-300">5. Swap Variables</h2>
47
- <p class="text-slate-300">Swap variable values without direct reassignment.</p>
48
  </a>
49
 
50
- <a href="salary.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
51
- <h2 class="text-xl font-semibold mb-2 text-blue-300">6. Salary Calculator</h2>
52
- <p class="text-slate-300">Compute net salary.</p>
53
  </a>
54
 
55
- <a href="bmi.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
56
- <h2 class="text-xl font-semibold mb-2 text-blue-300">7. BMI Calculator</h2>
57
- <p class="text-slate-300">Calculate Body Mass Index.</p>
58
  </a>
59
 
60
- <a href="string.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
61
- <h2 class="text-xl font-semibold mb-2 text-blue-300">8. String Manipulation</h2>
62
- <p class="text-slate-300">String operations and analysis.</p>
63
  </a>
64
 
65
- <a href="bank.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
66
- <h2 class="text-xl font-semibold mb-2 text-blue-300">9. Bank Account</h2>
67
- <p class="text-slate-300">Simulate bank transactions.</p>
68
  </a>
69
 
70
- <a href="grades.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
71
- <h2 class="text-xl font-semibold mb-2 text-blue-300">10. Grading System</h2>
72
- <p class="text-slate-300">Calculate student grades.</p>
73
  </a>
74
 
75
- <a href="currency.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
76
- <h2 class="text-xl font-semibold mb-2 text-blue-300">11. Currency Converter</h2>
77
- <p class="text-slate-300">Convert PHP to USD, EUR, JPY.</p>
78
  </a>
79
 
80
- <a href="travel.php" class="bg-slate-800 hover:bg-slate-700 transition-all rounded-lg p-6 shadow-lg border border-slate-700">
81
- <h2 class="text-xl font-semibold mb-2 text-blue-300">12. Travel Cost</h2>
82
- <p class="text-slate-300">Estimate travel expenses.</p>
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>
introduce.php CHANGED
@@ -9,8 +9,8 @@
9
  <style>
10
  body {
11
  font-family: 'Cairo Play', sans-serif;
12
- background-color: #0f172a;
13
- color: #e2e8f0;
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-2xl mx-auto">
22
- <a href="index.php" class="flex items-center text-blue-400 hover:text-blue-300 mb-8">
23
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
24
- <path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>
25
- </svg>
26
- <span class="ml-2">Back to tasks</span>
27
- </a>
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
- $name = "Alex";
34
- $age = 28;
35
- $favoriteColor = "blue";
36
-
37
- echo "<p class='text-lg mb-4'>Hi, I'm $name, I am $age years old, and my favorite color is $favoriteColor.</p>";
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>
math.php CHANGED
@@ -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: 'Share Tech Mono', monospace;
12
- background-color: #121212;
13
- color: #e0e0e0;
14
  }
15
- .window {
16
- background-color: #1e1e1e;
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="window">
43
- <div class="window-header flex items-center justify-between">
44
- <div class="flex items-center space-x-2">
45
- <div class="w-3 h-3 rounded-full bg-red-500"></div>
46
- <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
47
- <div class="w-3 h-3 rounded-full bg-green-500"></div>
48
- </div>
49
- <div class="text-xs" style="font-family: 'Cairo Play', sans-serif;">Simple Math Operations</div>
50
- <div class="w-12"></div>
51
- </div>
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="bg-gray-800 rounded-lg p-4">
102
- <div class="flex items-center mb-2">
103
- <div class="operation-icon mr-2">
104
- <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">
105
- <circle cx="12" cy="12" r="10"></circle>
106
- <line x1="8" y1="12" x2="16" y2="12"></line>
107
- <line x1="12" y1="8" x2="12" y2="16"></line>
108
- </svg>
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>
 
 
 
rectangle.php ADDED
@@ -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>
salary.php ADDED
@@ -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>
string.php ADDED
@@ -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>
swap.php ADDED
@@ -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>
temperature.php ADDED
@@ -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>
travel.php ADDED
@@ -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>