Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Thank you! /*Lab 8 : Practicing functions and arrays Purpose: */ #include #include using namespace std; int read_function(int array[], int, int); int main() { int

Thank you!

image text in transcribed

/*Lab 8 : Practicing functions and arrays Purpose: */

#include #include using namespace std;

int read_function(int array[], int, int);

int main() { int array[300], numba; read_function(array[300]); cout > numba; read_function(numba); return 0; }

int read_funtion (int arr[300], int num, int Values) { int sum=0; ifstream array_file; array_file.open("Lab8.dat"); for(int i=0; i > arr[i]; cout

This is what I am working with at the moment. I am not sure how the function is to have 3 parameters but then it says to call the function seperately for reading the array and calculating the numbers divisible by the whole number entered by the user.

Goals: Practicing arrays and functions into an array using a function other than main. The number of values in the file is less than 300 and all the values are whole Create a program that will read values from a file called Lab8.dat (posted on Canvas) and store it numbers. The actual number of values stored in the file should be returned to the function call Your program should contain another function that accepts the array, the number of values in the array, and a whole number array are evenly divisible by the whole number and return this count to the function call The loop should not contain more than 3 arithmetic operators ++ and + count as arithmetic operators, but = does not). ount how many values in the s function should use a loop to c The main function should call the function to read the data from the file. Next, ask the user to enter a whole number between 2 and 20 (you may assume the user enters a correct value). This whole number is the value to divide each element in the array. Next, call the function to how many values in the file are eveniy divisible by the entered whole number and output the returned count. The message should be something like 35 of the 189 values in the file were evenly divisible by 12 with the underlined values replaced by the your calculated values and the user's input

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

Define Decision making

Answered: 1 week ago

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago

Question

What are the skills of management ?

Answered: 1 week ago