the coding language is in c++
An array named testScores has already been declared.
-size= 5
-data type = float
- the array has already been initialized these values: 77, 88.5,
90, 93, 71.5
-Write one statement to declare a pointer named: ptr
- in the same statement, assign the address to the testScores array
to the pointer
-write one statement to output the memory address of the array
element at testScores[0]
-Write a for loop to output the values in the testScores array
declared above.
-assume the pointer holds the address of the first bite of the
array
-use the pointer in the cout statement. In other words, dereference
the pointer
- Include pointer arithmetic to move the pointer from one array
element to the next
I have implemented the above steps in c++. I have added comments for each line in code for you to understand it.
Note: You may see the screenshot of code to have better understanding of the indentation.
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:
\n";
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;
}
Output:

Screenshot of code:

the coding language is in c++ An array named testScores has already been declared. -size= 5...
In C
An array ints of integers has already been declared and initialized. A function printint has been defined with the following prototype: void printint(int *); Write code that will call printint with a pointer to the second value in the array ints. Note: you will not need to declare an int variable.
assume that input is an int array. the array is already declared and initialized wnd every element is assigned to an integer number. in addition assume that the array contains at least 1 element. write a code that contains one while loop abd no other loops to find both maximum and minimum numbers from input. then outout the maximum minus the minumum to the console window. (using java eclipse coding)
C Programming Language 2(a) Define a struct with 1 int array named i, 1 float array named f, and one double array named d, each of size M. (b)Declare array x with N of those structs. (c)Write a void function to traverse array x (using a pointer) assigning to each element in each array d (in each struct in array x) the sum of the corresponding elements in arrays i and f (in the same struct). Use 3 pointers (of...
a) Declare and instantiate an array named scores of twenty-five elements of type int. (b)Write a statement that declares an array namedstreetAddress that contains exactly eighty elements of typechar. 2. In a single statement: declare, create and initialize an arraynamed a of ten elements of type int with the values of the elements (starting with the first) set to 10, 20,..., 100 respectively. 3. Declare an array reference variable, week, and initialize it to an array containing the strings "mon",...
TRUE/FALSE 1. If pl is an integer pointer variable, with the value of 1000, pl++ changes P1 to point to the memory location 1001. ANSWER: T 2. When you return a dynamic array to the freestore, you must include the number of elements in the array 3. You can assign an array to a pointer variable. 4. The size of dynamic arrays must be declared at compile time. 5. int *pl; declares a static variable. ANSWER: F ANSWER: F ANSWER:...
Assuming that the array upc declared below has already been filled with MAX_LENGTH values, write a function that will ask to input an integer from the keyboard and perform a sequential search of the array for the input integer. If the input integer is found, print the index of the matching value in the array. Otherwise, print "Not found". Include declarations for all variables that you use. const int MAX_LENGTH = 25; int upc[MAX_LENGTH]; Please write in C++
C++ pointers and linked lists 1. Declare an integer pointer variable intPointer. Initialize it to point to an int variable named someInt. Assign the value 451 to someInt and output (cout) the variable someInt and output (cout) the value pointed to by intPointer. Write an assignment statement that indirectly stores 900 into the value pointed to by intPointer. Output (cout) the value pointed to by intPointer and output (cout) the variable someInt, 2. Declare a pointer variable charArrPointer and initialize...
In
C# (sharp)
Assuming a string variable named movie Title has already been declared, which one of the following statements combines the strings "Hidden" and "Figures" and then assigns the resulting string to the variable? 1. movieTitle="Hidden" + "Figures"; 2. "Hidden" +"Figures" - moveTitle; 3. movie Title("Hidden" +"Figures"); 4. movie title="Hidden" & "Figures": Look at the following code: int distance; // Declare distance as an int double half://Declare half as a double distance = 35; // Assign 35 to distance...
Need helps on C++ attach. Thanks
Pointers with classes a) A user-defined class named Timer has a constructor that takes two integer parameters to initialize hour and minute data members. Write a single C++ statement to create an object of the Timer class using dynamic memory allocation and assign it to a pointer variable named timePt r. It should call the constructor with two parameters. Use values of 10 and 20 for hour and minute respectively. b) Write the definition...
(C++ program )Write a function that accepts an int array and the array’s size as arguments. The function should create a new array that is one element larger than the argument array. The first element of the new array should be set to 0. Element 0 of the argument array should be copied to the element 1 of the new array. Element 1 of the argument array should be copied to element 2 of the new array, and so forth....