Your array must contain 10 elements. Collect these from the user. Print the original array to the console. Create a function and pass the original array to it as a parameter. Multiple the values of the original array by their index and store the product in an array local to your function. Print the second array (with the multiplied values) to the console.
Your array must contain 10 elements. Collect these from the user. Print the original array to the console. Create a function and pass the original array to it as a parameter. Multiple the values of the original array by their index and store the product in an array local to your function. Print the second array (with the multiplied values) to the console.
Chapter8: Arrays
Section: Chapter Questions
Problem 17RQ
Related questions
Question
100%
Hello, could you help with this c++
![Description: For this assignment, you will write a program with an array of 10 values collected from the
user. Pass the array to a function and multiple the values by their index. Store the product in a new array
and display the value. See the sample test data for examples.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F4d16f08f-73b0-4463-98b3-513a8db4696f%2F061ebb79-7dfb-4370-8f56-e67095c7ed3c%2Fwy1y9g8_processed.png&w=3840&q=75)
Transcribed Image Text:Description: For this assignment, you will write a program with an array of 10 values collected from the
user. Pass the array to a function and multiple the values by their index. Store the product in a new array
and display the value. See the sample test data for examples.
![Your array must contain 10 elements. Collect these from the user.
Print the original array to the console.
Create a function and pass the original array to it as a parameter.
Multiple the values of the original array by their index and store the product in an array local to
your function.
Print the second array (with the multiplied values) to the console.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F4d16f08f-73b0-4463-98b3-513a8db4696f%2F061ebb79-7dfb-4370-8f56-e67095c7ed3c%2Fgc1z8w_processed.png&w=3840&q=75)
Transcribed Image Text:Your array must contain 10 elements. Collect these from the user.
Print the original array to the console.
Create a function and pass the original array to it as a parameter.
Multiple the values of the original array by their index and store the product in an array local to
your function.
Print the second array (with the multiplied values) to the console.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
I tried to run this
![Source.cpp X
+1d Arrays exercise 1
1
2
3
4
90 %
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
211
Evoid func(int a[], int len) {
int b[len];
for (int
b[k]
A
#include <iostream>
using namespace std;
B
Bint main() {
8
Error List
Entire Solution
Code
▷ abc E0028
> C2131
X C3863
A C4552
(parameter) int len
Search Online
expression must have a constant value
cout <<
for (int the value of parameter "len" (declared at line 4) cannot be used as a constant
cout
Search Online
int arr[10];
X 1
cout << "Enter the 10 elemnents of array:" << endl;
for (int i = 0; i < 10; i++) {
cin >> arr[i];
}
cout << "The original array is:" << endl;
for (int j = 0; j < 10; j++) {
cout <<< arr[j] << " ";
A 0
个
↓
◄
(Global Scope)
3 Errors A 1 Warning
Description
expression must have a constant value
expression did not evaluate to a constant
array type 'int [len]' is not assignable
'<<': result of expression not used
✪ 0 of 3 Messages
197 Build + IntelliSense
func(int a[], int len)
▶
Project
1d Arrays exercise 1
1d Arrays exercise 1
1d Arrays exercise 1
1d Arrays exercise 1
Ln: 5
Ch: 9
File
Search Error List
Col: 12
Source.cpp
Source.cpp
Source.cpp
Source.cpp
TABS
+
CRLF
▼ д х
Line
5
5
7
12
8.
Toolbox Notifications Properties.](https://content.bartleby.com/qna-images/question/4d16f08f-73b0-4463-98b3-513a8db4696f/a95b57fa-f44e-42d1-87ae-ccf444c45340/2wdxexg_thumbnail.png)
Transcribed Image Text:Source.cpp X
+1d Arrays exercise 1
1
2
3
4
90 %
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
211
Evoid func(int a[], int len) {
int b[len];
for (int
b[k]
A
#include <iostream>
using namespace std;
B
Bint main() {
8
Error List
Entire Solution
Code
▷ abc E0028
> C2131
X C3863
A C4552
(parameter) int len
Search Online
expression must have a constant value
cout <<
for (int the value of parameter "len" (declared at line 4) cannot be used as a constant
cout
Search Online
int arr[10];
X 1
cout << "Enter the 10 elemnents of array:" << endl;
for (int i = 0; i < 10; i++) {
cin >> arr[i];
}
cout << "The original array is:" << endl;
for (int j = 0; j < 10; j++) {
cout <<< arr[j] << " ";
A 0
个
↓
◄
(Global Scope)
3 Errors A 1 Warning
Description
expression must have a constant value
expression did not evaluate to a constant
array type 'int [len]' is not assignable
'<<': result of expression not used
✪ 0 of 3 Messages
197 Build + IntelliSense
func(int a[], int len)
▶
Project
1d Arrays exercise 1
1d Arrays exercise 1
1d Arrays exercise 1
1d Arrays exercise 1
Ln: 5
Ch: 9
File
Search Error List
Col: 12
Source.cpp
Source.cpp
Source.cpp
Source.cpp
TABS
+
CRLF
▼ д х
Line
5
5
7
12
8.
Toolbox Notifications Properties.
Solution
Knowledge Booster
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.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage