Answer:
In the question given, we made use of c++ coding language for implementation.
Step-by-step explanation:
From this question given,
we make use of C++ code language
Now, executed the steps in c++ in the question. comments were also included for each line in code for better understanding.
C++ Code:
#include <iostream>
using namespace std;
//main function
int main()
{
//initialize the float array
float testScores[5] = {77, 88.5, 90, 93, 71.5};
//assign a pointer to the array
float *ptr = testScores;
//output memory address of first element in array
cout<<"Memory address of first element using & operator: "<<&testScores[0]<<endl;
cout<<"Memory address of first element using pointer: "<<ptr<<endl;
//display array elements using pointer in for loop
cout<<"Array elements using pointer: \\";
for(int i=0;i<5;i++)
{
//dereference pointer using *ptr and
//add i for subsequent elements in array
cout<<*(ptr+i)<<endl;
}
return 0;
}