Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ #1. Write a function that calculates the average of an array of integers of any size. Make sure you pass in reasonable parameters and

C++ #1. Write a function that calculates the average of an array of integers of any size. Make sure you pass in reasonable parameters and use appropriate names for your parameters and identifiers. In addition, include any necessary returning values. You do not need to document the code. Assume no global constants and include only the necessary preprocessor directives. #2. Write a function that reads sets of integer and floating point numbers from a file into parallel arrays. Each number is listed in a separate line in the input file. This is the only place where this file will be used so it should be declared within the function. However, the filename should be passed as a parameter to the function. Make sure you pass in reasonable parameters and name your parameters and identifiers appropriately. In addition, include any necessary returning values. You do not need to document the code. Include only the necessary preprocessor directives and assume no global constants. Create a small main program that call the two functions above and use it as testing for your functions. Please include at least 5 sets of integers and float point numbers in the input file. Make sure you output the entire parallel arrays and average calculated by the function #1. There is no need for documenting your code in this exercise.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions