c++ coding

User Generated

bh33

Programming

Description

For the arrays in these questions, unless i specify a size for the array, decide the size of the array for yourself.

1) Write a c++ program that contains the following functions, declare as many arrays as needed

a) A function that takes in an array as an input (parameter) and fills it up with whole number data from a file

b) A function that takes in the filled array and returns the sum of the array

c) A function that calculates that average of the array and prints out every element in the array less than the average

Use appropriate function calls to test the functions

2) Write a c++ program that contains the following functions, declare as many arrays as needed

a) A function that takes in an array as input and has the user enter in a sequence of characters to store in the array (use a character array)

b) A function that takes in the character array as input and returns the number of vowels inside the array

c) A function to print the content of the array one per line

d) A function that takes in two arrays as input an copies the content of the filled array into the empty one.

3)Redo question 3 on homework one using arrays. add a function to read the numbers from the file into the array,and redo the other functions using the array. (this is the question)

--------

3) Write a program that contains the following functions (There are 25 numbers contained in a file)

A function to;

Determine and output the amount of even numbers

Determine and output the amount of odd numbers

Determine and output the amount of positive numbers

Determine and output the amount of negative numbers

Determine and output the number of zeros

Determine and output the sum of all 25 numbers

Use appropriate function calls in the main function. (Note: Negative numbers can also be odd and even)

Create the file and use the following numbers

0 2 -12 15 0 -7 -1 28 123 14 -863 17

11 -189 0 1283 290 -120 151 -63 13 230 0 -77 -2

--------

4) Do programming exercise 1 in chapter 8 of the textbook (C++ From Problem Analysis to Program Design . D.S. Malik. 8th Edition). Your program should contain the following functions (index in the question refers to the address of the array\ LCV )

a) A function to fill up the array as directed by the exercise

b) A function to output the content of the array (Does not need to be 10 per line, haven't explained this in class yet)

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Here are the solutions for Question 1, 2 and 3. Question 4 and question "3)Redo question 3 o...


Anonymous
Great! Studypool always delivers quality work.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags