write a program that reads up to 100 numbers from a file. As you read the numbers, insert them into an array in ascending order. Specifications: 1A. Write a function called addToArrayAsc. i. It should take three arguments - a. sortedArray[ ] : sorted array that should be able to hold at most 100 floats. b. numElements : the number of elements inserted so far. c. newValue : the incoming float value to be inserted into the sortedArray. ii. The addToArrayAsc function should return a count of the elements inserted so far (i.e. the current size of the array). The function header will appear as follows: OBJECTIVES 1. Read-in command line arguments 2. Read a file 3. Loop through an array 4. Split a string 5. Create an array of struct types 6. Read and Write to a file int addToArrayAsc(float sortedArray[], int numElements, float newValue);
write a program that reads up to 100 numbers from a file. As you read the
numbers, insert them into an array in ascending order.
Specifications:
1A. Write a function called addToArrayAsc.
i. It should take three arguments -
a. sortedArray[ ] : sorted array that should be able to hold at most 100 floats.
b. numElements : the number of elements inserted so far.
c. newValue : the incoming float value to be inserted into the sortedArray.
ii. The addToArrayAsc function should return a count of the elements inserted so far
(i.e. the current size of the array).
The function header will appear as follows:
OBJECTIVES
1. Read-in command line arguments
2. Read a file
3. Loop through an array
4. Split a string
5. Create an array of struct types
6. Read and Write to a file
int addToArrayAsc(float sortedArray[], int numElements, float newValue);
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images