Activity - 09/15 - Arrays


My car will be a BMW once I graduate.
Friend #1 is: Mike.
Friend #2 is: Matt.
Friend #3 is: Minnie.
Friend #4 is: Joe.
Friend #5 is: Mick.
Friend #6 is: Gorbachev.
Friend #7 is: .

Friend #1 is: Mike.
Friend #2 is: Matt.
Friend #3 is: Minnie.
Friend #4 is: Joe.
Friend #5 is: Mick.
Friend #6 is: Gorbachev.
Friend #11 is: Gorbachev's Brother.

foreach() loops allow you to run through EVERY array element, regardless of different indexes.


Student name: Mike has ID #123456
Student name: Matt has ID #122233
Student name: Minnie has ID #133356
Student name: Joe has ID #223456
Student name: Mick has ID #321256
Student name: Gorbachev has ID #112312
Student name: Gorbachev's Brother has ID #989899

Total salary expense is: $1248409

The employee with the highest salary is Gorchachev's Brother with $1233330
The employee with the lowest salary is Matt with $12

Lowest Salary Extra: Matt with $12
Lowest Salary Extra: Gorbachev with $12


The second highest salary is Minnie with $10001


2d arrays:


Student No. 1

Student No. 2

Student No. 3

Student No. 4

Student No. 5


No.NameAgeGender
1Mike22Male
2Gorbachev91Male
3Minnie250Female
4Jennie18Female
5Jackson22Male


Name: Gorbachev - Age: 91 - Gender: Male
Name: Gorbachev - Age: 91 - Gender: Male
Name: Gorbachev - Age: 26 - Gender: Male
In total, there are 2 students with the name Gorbachev.


Name: Mike - Age: 22 - Gender: Male
Name: Jackson - Age: 22 - Gender: Male

There are 2 students that are age 22