Skip to content

Commit dad79f9

Browse files
authored
Merge pull request #82 from JSK-KML/test-main
Test main
2 parents 1846cf2 + 99afedb commit dad79f9

13 files changed

Lines changed: 453 additions & 67 deletions

docs/.vitepress/config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export default defineConfig({
5050
{ text: 'Lab 4', link: '/labs/lab-04' },
5151
{ text: 'Lab 5', link: '/labs/lab-05' },
5252
{ text: 'Lab 6', link: '/labs/lab-06' },
53-
{ text: 'Lab 7', link: '/labs/lab-07' }
53+
{ text: 'Lab 7', link: '/labs/lab-07' },
54+
{ text: 'Lab 8', link: '/labs/lab-08' }
5455
],
5556
activeMatch: '^/labs/'
5657
},
@@ -120,6 +121,10 @@ export default defineConfig({
120121
{
121122
text: 'Lab 7',
122123
link: '/labs/lab-07'
124+
},
125+
{
126+
text: 'Lab 8',
127+
link: '/labs/lab-08'
123128
}
124129
],
125130

docs/labs/lab-02.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Click the `Actions` tab and click the latest workflow inside the `Actions`.
166166

167167
Inside the workflow, you’ll see a clear error message showing why it failed. This might say the file is missing, wrongly named, or contains something invalid.
168168

169-
### Successful Action Workflow <Badge type="tip" text="Task" />
169+
### Successful Action Workflow <Badge type="warning" text="Task" />
170170

171171
Your task is to read the error message and correct the mistake based on the error. If the workflow is successfull, you should see a green tick next to your commit message.
172172

docs/labs/lab-03.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Copy and paste the given code from the window into `lab-3-1.py` and save the fil
159159

160160

161161

162-
## Scenario 1 – Hotel Reservation <Badge type="tip" text="Question" />
162+
## Scenario 1 – Hotel Reservation <Badge type="warning" text="Question" />
163163

164164
Question:
165165
Mr Rahman plans to make a reservation for a hotel room in Langkawi Island. The basic rate is RM250.00 per night and service charge is 15% of the room rate. Determine the total payment if he books the hotel room for n nights.
@@ -177,7 +177,7 @@ Outputs (in order):
177177
- `TOTAL_PAYMENT` – sum of room rate and service charge (RM)
178178

179179

180-
## Scenario 2 – Storage Conversion <Badge type="tip" text="Question" />
180+
## Scenario 2 – Storage Conversion <Badge type="warning" text="Question" />
181181
Question:
182182
Prompt user to input a size in Kilobyte, and convert the input into Megabyte, Gigabyte, Terabyte and Petabyte.
183183

@@ -200,7 +200,7 @@ Outputs (order):
200200
`petabyte`
201201

202202

203-
## Scenario 3 – International Fax Cost <Badge type="tip" text="Question" />
203+
## Scenario 3 – International Fax Cost <Badge type="warning" text="Question" />
204204

205205
Question:
206206
Amin’s program calculates the cost of sending an international fax: service charge RM3.00 plus RM0.20 per page.
@@ -218,7 +218,7 @@ Outputs (order):
218218
`TOTAL_COST` – sum of service charge and pages cost
219219

220220

221-
## Scenario 4 – Cookie Calories <Badge type="tip" text="Question" />
221+
## Scenario 4 – Cookie Calories <Badge type="warning" text="Question" />
222222

223223
Question:
224224
A pack contains 40 pieces of cookies. The calorie info claims 10 servings per pack. Each serving equals 300 calories. Calculate the total calories consumed based on number of packs eaten.
@@ -235,7 +235,7 @@ Outputs (order):
235235

236236
- `TOTAL_CALORIES` – SERVINGS_CONSUMED * 300
237237

238-
## Scenario 5 – Wage to Mow Yard <Badge type="tip" text="Question" />
238+
## Scenario 5 – Wage to Mow Yard <Badge type="warning" text="Question" />
239239

240240
Question:
241241
The wage to mow the yard is based on diesel price RM2.00 per square meter. The yard area is the large rectangle minus the house rectangle. You are given the length and width of the yard boundary and the length and width of the house. Calculate the wage.
@@ -260,7 +260,7 @@ Outputs (order):
260260

261261
- `WAGE` – Total wage
262262

263-
## Scenario 6 – Temperature Conversion <Badge type="tip" text="Question" />
263+
## Scenario 6 – Temperature Conversion <Badge type="warning" text="Question" />
264264

265265
Question
266266
Prompt user to input a temperature in Celsius and convert it to Fahrenheit and Kelvin.
@@ -279,7 +279,7 @@ Outputs (in order)
279279

280280
- `kelvin`
281281

282-
## Scenario 7 – Simple Interest Calculator <Badge type="tip" text="Question" />
282+
## Scenario 7 – Simple Interest Calculator <Badge type="warning" text="Question" />
283283

284284
Question:
285285
Prompt user for principal (P), annual rate (R %) and time (T years); calculate:

docs/labs/lab-04.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ Then it will prompt you the location that you want the image saved and the name
103103

104104
## Selection Questions
105105

106-
### Scenario 1 - Electricity Bill <Badge type="tip" text="Question" />
106+
### Scenario 1 - Electricity Bill <Badge type="warning" text="Question" />
107107
A utility company charges RM0.30 per kWh for the first 100 kWh, RM0.50 per kWh for the next 100 kWh (101–200 kWh), and RM0.75 per kWh for any usage above 200 kWh.
108108

109109
Calculate the total bill when the customer enters their total kWh consumed.
110110

111-
### Scenario 2 - Income Tax Slab <Badge type="tip" text="Question" />
111+
### Scenario 2 - Income Tax Slab <Badge type="warning" text="Question" />
112112
Income tax is applied as:
113113

114114
- First RM50,000.00 → 0%
@@ -119,7 +119,7 @@ Income tax is applied as:
119119

120120
Given an annual income, calculate total tax due.
121121

122-
### Scenario 3 - Parking Fee <Badge type="tip" text="Question" />
122+
### Scenario 3 - Parking Fee <Badge type="warning" text="Question" />
123123

124124
A mall charges parking as follows:
125125

@@ -133,7 +133,7 @@ Maximum charge per day → RM30.00
133133

134134
Given total hours parked, calculate the parking fee.
135135

136-
### Scenario 4 - Baggage Allowance Logic <Badge type="tip" text="Question" />
136+
### Scenario 4 - Baggage Allowance Logic <Badge type="warning" text="Question" />
137137

138138
A flight ticket that includes 15 kg of free baggage.Excess baggage is charged RM4.00 per kg beyond that limit.
139139
However, if the passenger brings no baggage, they receive a RM10.00 discount on the total ticket price.

docs/labs/lab-05.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Some of the most commonly used **Python** keywords include `if`, `else`, `while`
6565

6666
These keywords are highlighted differently in **VS Code** because the editor recognizes them as special **Python** syntax. Notice how **VS Code** uses color coding to help you identify different types of code elements. Keywords typically appear in a different color than variables or strings.
6767

68-
### Listing Python Keyword <Badge type="tip" text="Task" />
68+
### Listing Python Keyword <Badge type="warning" text="Task" />
6969

7070
Copy this code into your `exercise.py` file:
7171

@@ -197,7 +197,7 @@ print("Final Grade: " + str(final_grade) + "%")
197197

198198

199199

200-
## Exercise 1: Student Information System <Badge type="tip" text="Task" />
200+
## Exercise 1: Student Information System <Badge type="warning" text="Task" />
201201

202202
Create a new file called `exercise1.py` in the `/labs/lab05/` directory. This exercise combines **variables**, **data types**, and **input/output statements**.
203203

@@ -207,7 +207,7 @@ Write a program that:
207207
3. Displays the student information and shows the data types
208208

209209

210-
## Exercise 2: Circle Calculator <Badge type="tip" text="Task" />
210+
## Exercise 2: Circle Calculator <Badge type="warning" text="Task" />
211211

212212
Create a new file called `exercise2.py` in the `/labs/lab05/` directory. This exercise combines **import statements**, **variables**, and **data types**.
213213

@@ -216,7 +216,7 @@ Write a program that:
216216
2. Takes a radius of circle from the user
217217
3. Print the area and circumference of the circle
218218

219-
## Exercise 3: Random Student Selector <Badge type="tip" text="Task" />
219+
## Exercise 3: Random Student Selector <Badge type="warning" text="Task" />
220220

221221
Create a new file called `exercise3.py` in the `/labs/lab05/` directory. This exercise combines **import statements**, **variables**, and **input/output statements**.
222222

@@ -225,7 +225,7 @@ Write a program that:
225225
2. Takes the student's class name from the user
226226
3. Generates a random number and displays class information
227227

228-
## Exercise 4: Shopping Cost Calculator <Badge type="tip" text="Task" />
228+
## Exercise 4: Shopping Cost Calculator <Badge type="warning" text="Task" />
229229

230230
Create a new file called `exercise4.py` in the `/labs/lab05/` directory. This exercise combines **variables**, **data types**, and **input/output statements**.
231231

@@ -234,7 +234,7 @@ Write a program that:
234234
2. Creates variables for quantity (3 items) and tax rate (6%)
235235
3. Calculates and displays subtotal, tax amount, and total cost
236236

237-
## Exercise 5: Average Score Calculator <Badge type="tip" text="Task" />
237+
## Exercise 5: Average Score Calculator <Badge type="warning" text="Task" />
238238

239239
Create a new file called `exercise5.py` in the `/labs/lab05/` directory. This exercise combines **variables**, **data types**, and **input/output statements**.
240240

@@ -243,7 +243,7 @@ Write a program that:
243243
2. Calculates the total score and average score
244244
3. Displays all individual scores, total, and average
245245

246-
## Exercise 6: Time Converter <Badge type="tip" text="Task" />
246+
## Exercise 6: Time Converter <Badge type="warning" text="Task" />
247247

248248
Create a new file called `exercise6.py` in the `/labs/lab05/` directory. This exercise combines **variables**, **data types**, and **input/output statements**.
249249

@@ -252,7 +252,7 @@ Write a program that:
252252
2. Converts minutes to hours and remaining minutes
253253
3. Displays the original minutes and converted time format
254254

255-
## Exercise 7: Advanced Math Operations <Badge type="tip" text="Task" />
255+
## Exercise 7: Advanced Math Operations <Badge type="warning" text="Task" />
256256

257257
Create a new file called `exercise7.py` in the `/labs/lab05/` directory. This exercise combines **import statements**, **variables**, and **data types**.
258258

docs/labs/lab-06.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Why is it so important to follow convention? Right now you might be wondering, i
109109

110110
Having a convention is nice because your friends know what to expect from your coding style and vice versa. You also know what to expect from them.
111111

112-
### Variables Naming Exercise <Badge type="tip" text="Question" />
112+
### Variables Naming Exercise <Badge type="warning" text="Question" />
113113

114114
Create a file called `exercise1.py`. Implement the solutions for this exercise in there. Debug and fix this program with variable naming errors. Change the variable name to follow snake case
115115

@@ -205,7 +205,7 @@ Python is awesome,
205205
And so are you!
206206
```
207207

208-
### String Quotes Exercise <Badge type="tip" text="Task" />
208+
### String Quotes Exercise <Badge type="warning" text="Task" />
209209

210210
Create a file called `exercise2.py`. Write a program that demonstrates the use of all three types of quotes:
211211

@@ -259,7 +259,7 @@ print(len(student_name))
259259
print(len("Hello World"))
260260
```
261261

262-
### String Operations Exercise <Badge type="tip" text="Task" />
262+
### String Operations Exercise <Badge type="warning" text="Task" />
263263

264264
Create a file called `exercise3.py`. Write a program that:
265265

@@ -349,7 +349,7 @@ Ali 20 A
349349
Sarah 19 B+
350350
```
351351

352-
### Escape Characters Exercise <Badge type="tip" text="Task" />
352+
### Escape Characters Exercise <Badge type="warning" text="Task" />
353353

354354
Create a file called `exercise4.py`. Write a program that creates a formatted receipt using `\n` and `\t`:
355355

docs/labs/lab-07.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ print(message)
275275
Hello Sarah, your score is 92
276276
```
277277

278-
### F-String Exercise <Badge type="tip" text="Task" />
278+
### F-String Exercise <Badge type="warning" text="Task" />
279279

280280
Create a file called `exercise1.py`. Practice using f-strings by rewriting these string concatenation examples:
281281

@@ -372,7 +372,7 @@ Name in UPPERCASE: ALI RAHMAN
372372
Name length: 10 characters
373373
```
374374

375-
### Import Exercise <Badge type="tip" text="Task" />
375+
### Import Exercise <Badge type="warning" text="Task" />
376376

377377
Create a folder called `exercise2` and practice creating and importing your own module:
378378

@@ -381,7 +381,7 @@ Create a folder called `exercise2` and practice creating and importing your own
381381
- Calculate total cost
382382
2. In the same folder, create `exercise2.py` that imports `shopping_data` and displays the information using f-strings
383383

384-
## Combining F-Strings with Your Own Imports <Badge type="tip" text="Task" />
384+
## Combining F-Strings with Your Own Imports <Badge type="warning" text="Task" />
385385

386386
Create a folder called `exercise3` in `/labs/lab07`.
387387

@@ -395,7 +395,7 @@ Create a folder called `exercise3` in `/labs/lab07`.
395395

396396
2. In the same folder, create `exercise3.py` that imports `school_data` and uses f-strings to display all the information in a formatted report
397397

398-
## Exercise 4: Restaurant Menu System <Badge type="tip" text="Task" />
398+
## Exercise 4: Restaurant Menu System <Badge type="warning" text="Task" />
399399

400400
Create a folder called `exercise4` in `/labs/lab07`.
401401

@@ -423,7 +423,7 @@ Create a folder called `exercise4` in `/labs/lab07`.
423423
- Complete menu with all items
424424
- Today's special (based on the random number)
425425

426-
## Exercise 5: Personal Information Manager <Badge type="tip" text="Task" />
426+
## Exercise 5: Personal Information Manager <Badge type="warning" text="Task" />
427427

428428
Create a folder called `exercise5`in `/labs/lab07`.
429429

@@ -448,6 +448,6 @@ Create a folder called `exercise5`in `/labs/lab07`.
448448
2. Uses f-strings to display a comprehensive profile with:
449449
- Basic personal information section
450450
- String processing results
451-
- Address information section
451+
- Address information sections
452452

453453

0 commit comments

Comments
 (0)