CODE USING C++ 1. Show me the world by CodeChum Admin Hi Programmer, I'm planning to impress my crush. It seems that she likes nerd stuff so what I'm planning to do is I want to show her all of the world array I have.   Can you help me with this?   Instructions: In the code editor, you are provided with the main() function that declares an array with initial values and calls the display() function. This display() function hasn't been declared and defined yet. This is your task. The details of this function are: Return type - void Name - display Parameters int* - an array int - the size of an array Output Element·at·index·0:·1 Element·at·index·1:·3 Element·at·index·2:·2 Element·at·index·3:·4 Element·at·index·4:·5 Element·at·index·5:·7 Element·at·index·6:·6 Element·at·index·7:·8 Element·at·index·8:·9 Element·at·index·9:·11 Element·at·index·10:·100 Element·at·index·11:·13 Element·at·index·12:·0 Element·at·index·13:·14 .

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question

CODE USING C++

1. Show me the world

by CodeChum Admin

Hi Programmer, I'm planning to impress my crush. It seems that she likes nerd stuff so what I'm planning to do is I want to show her all of the world array I have.

 

Can you help me with this?

 

Instructions:

  1. In the code editor, you are provided with the main() function that declares an array with initial values and calls the display() function.
  2. This display() function hasn't been declared and defined yet. This is your task. The details of this function are:
    1. Return type - void
    2. Name - display
    3. Parameters
      1. int* - an array
      2. int - the size of an array

Output

Element·at·index·0:·1
Element·at·index·1:·3
Element·at·index·2:·2
Element·at·index·3:·4
Element·at·index·4:·5
Element·at·index·5:·7
Element·at·index·6:·6
Element·at·index·7:·8
Element·at·index·8:·9
Element·at·index·9:·11
Element·at·index·10:·100
Element·at·index·11:·13
Element·at·index·12:·0
Element·at·index·13:·14
.
.
.
values and calls the display()
main.cpp
> + c++
function.
2. This display() function hasn't been
1 #include <iostream>
declared and defined yet. This is
2 using namespace std;
your task. The details of this
function are:
4 |/ TODO: Declare the display() function here
5
1. Return type - void
2. Name - display
6 int main(void) {
int world[100] - {
1,3,2,4,5,7,6,8,9,11,
100,13,0,14,16,17,3,18,20,10,
12,8,15,14, -5,17,19,18,1,9,5,
10,13,11,14,16,22,0,18,20,3,
99,13,15,14, 22,17,19,0,23,2,
12,13,15,22,16,17,56,18,44,99,
2,13,22,14,16,89,19,69,101,34,
12,22,15,14,78,17,69,18,2,33,
4,13,77,7,10,17,19,91,4,22,
12,98,15,14,15,17,19,18,7
};
7
3. Parameters
8
1. int* - an array
9
10
2. int - the size of an
11
array
12
13
14
Output
15
16
17
Element at index 0: 1
18
Element at index 1: 3
19
Element at index 2: 2
20
display (world, 100);
21
Element at index 3: 4
22
return 0;
Element at index 4: 5
23 }
Element at index 5: 7
24
Element
inde
6:
25 // TODO: Define the display() function here
Element at index 7: 8
Element at index 8: 9
Element at index 9: 11
Element at index 10: 100
Element at index 11: 13
Element at index 12: 0
Element at index 13: 14
Transcribed Image Text:values and calls the display() main.cpp > + c++ function. 2. This display() function hasn't been 1 #include <iostream> declared and defined yet. This is 2 using namespace std; your task. The details of this function are: 4 |/ TODO: Declare the display() function here 5 1. Return type - void 2. Name - display 6 int main(void) { int world[100] - { 1,3,2,4,5,7,6,8,9,11, 100,13,0,14,16,17,3,18,20,10, 12,8,15,14, -5,17,19,18,1,9,5, 10,13,11,14,16,22,0,18,20,3, 99,13,15,14, 22,17,19,0,23,2, 12,13,15,22,16,17,56,18,44,99, 2,13,22,14,16,89,19,69,101,34, 12,22,15,14,78,17,69,18,2,33, 4,13,77,7,10,17,19,91,4,22, 12,98,15,14,15,17,19,18,7 }; 7 3. Parameters 8 1. int* - an array 9 10 2. int - the size of an 11 array 12 13 14 Output 15 16 17 Element at index 0: 1 18 Element at index 1: 3 19 Element at index 2: 2 20 display (world, 100); 21 Element at index 3: 4 22 return 0; Element at index 4: 5 23 } Element at index 5: 7 24 Element inde 6: 25 // TODO: Define the display() function here Element at index 7: 8 Element at index 8: 9 Element at index 9: 11 Element at index 10: 100 Element at index 11: 13 Element at index 12: 0 Element at index 13: 14
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning