1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aleksandrvk [35]
3 years ago
9

Given: An array named testScores has already been declared. - size = 5 data type = float. - The array has already been initializ

ed with 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 of the testScores array to the pointer.
Computers and Technology
1 answer:
Marina CMI [18]3 years ago
7 0

Answer:

<em>In the question given, we made  use of c++ coding language for implementation.</em>

Explanation:

<em>From this question given,</em>

<em>we make use of C++ code language</em>

<em>Now, executed  the  steps in c++ in the question. comments were also included for each line in code for better understanding.</em>

<em>C++ Code: </em>

<em> #include <iostream> </em>

<em>using namespace std; </em>

<em> //main function </em>

<em>int main() </em>

<em>{ </em>

<em>    //initialize the float array </em>

<em>    float testScores[5] = {77, 88.5, 90, 93, 71.5}; </em>

<em>   </em>

<em>     //assign a pointer to the array </em>

<em>    float *ptr = testScores; </em>

<em>   </em>

<em>    //output memory address of first element in array </em>

<em>    cout<<"Memory address of first element using & operator: "<<&testScores[0]<<endl; </em>

<em>    cout<<"Memory address of first element using pointer: "<<ptr<<endl; </em>

<em>   </em>

<em>    //display array elements using pointer in for loop </em>

<em>    cout<<"Array elements using pointer: \n"; </em>

<em>    for(int i=0;i<5;i++) </em>

<em>    { </em>

<em>        //dereference pointer using *ptr and </em>

<em>        //add i for subsequent elements in array </em>

<em>        cout<<*(ptr+i)<<endl; </em>

<em>    } </em>

<em>   return 0; </em>

<em>}</em>

You might be interested in
In 1971, Intel created and marketed the first microprocessor chip, called the Intel 4004. What was significant about this invent
PilotLPTM [1.2K]
The answer is D

<span>D) It allowed computers to be smaller because the chip allowed for the creation of computer components with varying capabilities.</span>
7 0
3 years ago
How many generations of computer languages have there been since the middle of the 20th century?
evablogger [386]
4 generations hahahaha
3 0
3 years ago
Read 2 more answers
Imagine that one of your clients has complained to your manager that you have not responded quickly to his e-mails. Compose an e
Galina-37 [17]
Dear Mr. _____,
I am truly sorry for the inconvenience and I promise to work faster to more quickly solve your problem so that you can continue to enjoy your day without worrying about the situation. Next time I will respond back faster to ensure that your problem is fixed as quickly as possible.

Sincerely,
_____________

6 0
3 years ago
Which is an unbound form with menu options for navigating a database?
melisa1 [442]
The answer B. a switchboard
6 0
3 years ago
Read 2 more answers
What are at least three tips to taking photographs of insects? Why would following the tips help create better photographs?
Ber [7]

1) Use a good cam 2) Make sure you focus on it 3) Make sure you snap it at the right time....    I hope this helps!!!!!

7 0
3 years ago
Other questions:
  • Which element of the security policy framework requires approval from upper management and applies to the entire organization?A.
    5·1 answer
  • How is a Personal Fact Sheet used? a. A Personal Fact Sheet is a tool used to market yourself and build your network b. A Person
    13·2 answers
  • In Microsoft Word, how would you change the amount of space that is put in after each paragraph?
    15·1 answer
  • Which of the following jobs is considered part of the information technology industry?
    15·2 answers
  • Please help me answer this question
    14·1 answer
  • Rewrite this if/else if code segment into a switch statement int num = 0; int a = 10, b = 20, c = 20, d = 30, x = 40; if (num &g
    13·1 answer
  • Some one help pls will mark brainless !!!!!
    13·1 answer
  • Write a program to input a number.Find the sum of digits and number of digits
    10·2 answers
  • Write a pseudocode for the logic of a program that accepts five numbers from a user and displays one of the following messages:-
    8·1 answer
  • HELP PLEASE
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!