https://github.com/julianamancera/appdev_lab-3_php
Applications Development & Emerging Technologies - PHP Lab Activity #3
https://github.com/julianamancera/appdev_lab-3_php
application-development emerging-technology php
Last synced: 2 months ago
JSON representation
Applications Development & Emerging Technologies - PHP Lab Activity #3
- Host: GitHub
- URL: https://github.com/julianamancera/appdev_lab-3_php
- Owner: JulianaMancera
- Created: 2025-02-14T12:12:29.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-02-14T12:48:41.000Z (12 months ago)
- Last Synced: 2025-02-14T13:26:01.124Z (12 months ago)
- Topics: application-development, emerging-technology, php
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AppDev_Lab-3_PHP
### Challenge 1
Create a multiplication table using a nested `for loop`. The table output should look like this:
**Multiplication Table**
```
1 x 1 = 1
1 x 2 = 2
1 x 3 = 3
1 x 4 = 4
1 x 5 = 5
1 x 6 = 6
1 x 7 = 7
1 x 8 = 8
1 x 9 = 9
1 x 10 = 10
and so on...
```
### Challenge 2
Get the sum of the numbers in an array by using a foreach loop and for loop.
`$numbers = [1, 2, 3, 4, 5]; //sum using foreach loop`
`$numbers2 = [1, 2, 3, 4, 5,6,7,8,9,19]; //sum using for loop`
**Sample Output**
```
Sum array using foreach loop
15
Sum array using for loop
64
```
### Challenge 3
Calculate the average students grade from an array of students. Each student has their own array with the key `grades`.
1. Create an array of students with their names and grades (0 - 100)
`john 85, 90, 92, 88`
`jane 95, 88, 91, 87`
`joe 75, 82, 79, 88`
2. Iterate over the students array with a foreach loop
3. Calculate the average grade for each student.
**Sample Output**
```
Average Grade
John: Average Grade = 88.75
Jane: Average Grade = 90.25
Joe: Average Grade = 81