Objective: Arrays, Passing arrays to functions, Creating data in tabular form 1- Write a user-defined function that accepts an array of integers. The function should generate the percentage each value in the array is of the total of all array values. Store the % value in another array. That array should also be declared as a formal parameter of the function. 2- In the main function, create a prompt that asks the user for inputs to the array. Ask the user to enter up to 20 values, and type -1 when done. (-1 is the sentinel value). It marks the end of the array. A user can put in any number of variables up to 20 (20 is the size of the array, it could be partially filled). 3- Display a table like the following example, showing each data value and what percentage each value is of the total of all array values. Do this by invoking the function in part 1.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.1: One-dimensional Arrays
Problem 10E: (Electrical eng.) Write a program that specifies three one-dimensional arrays named current,...
icon
Related questions
Question
Objective: Arrays, Passing arrays to functions, Creating data in tabular form
1- Write a user-defined function that accepts an array of integers. The function should generate
the percentage each value in the array is of the total of all array values. Store the % value in
another array. That array should also be declared as a formal parameter of the function.
2- In the main function, create a prompt that asks the user for inputs to the array. Ask the user
to enter up to 20 values, and type -1 when done. (-1 is the sentinel value). It marks the end
of the array. A user can put in any number of variables up to 20 (20 is the size of the array, it
could be partially filled).
3- Display a table like the following example, showing each data value and what percentage
each value is of the total of all array values. Do this by invoking the function in part 1.
Index
Value
+ of total
4.00
6.00
9.00
1
2
18
3
25
12.50
24
12.00
5
30
15.00
14.00
6
28
7
22
11.00
23
11.50
10
5.00
O CO N COn O0 N mo
Transcribed Image Text:Objective: Arrays, Passing arrays to functions, Creating data in tabular form 1- Write a user-defined function that accepts an array of integers. The function should generate the percentage each value in the array is of the total of all array values. Store the % value in another array. That array should also be declared as a formal parameter of the function. 2- In the main function, create a prompt that asks the user for inputs to the array. Ask the user to enter up to 20 values, and type -1 when done. (-1 is the sentinel value). It marks the end of the array. A user can put in any number of variables up to 20 (20 is the size of the array, it could be partially filled). 3- Display a table like the following example, showing each data value and what percentage each value is of the total of all array values. Do this by invoking the function in part 1. Index Value + of total 4.00 6.00 9.00 1 2 18 3 25 12.50 24 12.00 5 30 15.00 14.00 6 28 7 22 11.00 23 11.50 10 5.00 O CO N COn O0 N mo
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
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
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,