Write a c++ program that will manipulate an array

Assignment Help C/C++ Programming
Reference no: EM13936690

Write a C++ program that will manipulate an array. It should handle up to 100 integer numbers. Write a separate function for each of the requirements mentioned below. Label the output appropriately.

Read in the values from attached file "array.dat" into the array. The last value is a 0 and is not one of the values to be used in any of the calculations mentioned below.

1. Print out all the values in the array with no more than 10 numbers per output line.

2. Print out the average of the numbers.

3. Print out how many numbers are larger than the average and how many are smaller than the average. Pass average as a parameter.

4. For every odd location in the array, subtract it from the previous even location and store results in the even location. Print out all values in the array.

5. Print out the average for the new array.

6. Find the smallest value in the array and print out its value and its location in the array.

7. Convert every negative number in the array to corresponding positive number. Print out the array.

8. Find the largest value in the array and print out its value and its location in the array.

9. Swap the first number in the array with the last number in the array. Print out the array.

10. Print out the average for the new array.

Attachment:- array.zip

Reference no: EM13936690

Questions Cloud

Use the heuristic evaluation method : For this coursework you must provide an Expert Appraisal of the Just Eat's takeway interface (web or mobile app) (http://just-eat.co.uk) in a web browser or phone of your choice.
Explain roles of hardware and software components : Discussion is designed to help you understand the roles of hardware and software components in a modern computer system. For the purposes of this Discussion, assume that you are heading a team of 25 people working on a software development project..
Dna replication is a method of growth, repair, and recovery : DNA replication is a method of growth, repair, and recovery. Give me the highlights for a cell making nuclear copies and for cells dividing for reproductive purposes. Not too much detail, because this could get lengthy. I will ask for more depth i..
Knowledge gap in senior management : The internet uses a network technology called TCP/IP. The name comes from the protocol stack that includes TCP protocol in the transport layer and IP protocol in the network layer. Sometimes UDP ..
Write a c++ program that will manipulate an array : Write a C++ program that will manipulate an array. It should handle up to 100 integer numbers. Write a separate function for each of the requirements mentioned below. Label the output appropriately.
Practical application of accounting theory : Write an explanation of each theory sourced, in the most part from the academic journal articles evaluated in Part A above (you may use additional sources to support your discussion including your set text).
Write a program to generate a table of factors : Write a program to generate a table of factors used to compute monthly payments for the money borrowed.
The internet uses a network technology : The internet uses a network technology called TCP/IP. The name comes from the protocol stack that includes TCP protocol in the transport layer and IP protocol in the network layer. Sometimes UDP protocol is used in the Transport layer ..
Consider a market where supply and demand : Consider a market where supply and demand are given by QXS = -10 + PX and QXd = 71 - 2PX. Suppose the government imposes a price floor of $33, and agrees to purchase any and all units consumers do not buy at the floor price of $33 per unit.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write down program in c for matrix multiplication program

write down program in c for matrix multiplication. program must accept dimension of both matrices to be multiplied and

  Design and implement a dynamic doubly linked list

Design and implement a dynamic doubly linked list - Allocate and de-allocate memory at runtime - Analyze a basic set of requirements for a problem

  The definition for a printallplayers() function

Add the Prototype, a call and the definition for a printAllPlayers() function that prints to STDOUT (using cout) each players name and all of their at-bat stats. Only print out the values of the stats array up to timesAtBat.

  Create a program for a company named retail-mart

Prompt the user to enter an item name (one word only), a quantity and a price. For this step, in addition to functionality, I'll be looking at: location of the variable declarations; appropriateness of data types selected; appropriateness of the va..

  Write a program to open a file for reading

Write a program to open a file for reading that has twenty (20) rows and in each row there are three (3) columns.

  Uses the sieve of eratosthenes algorithm

Write a complete program that uses the Sieve of Eratosthenes algorithm to list all prime numbers from 1 to 1,000 .

  Write the copy-array procedure by a function

Write the C++ statement that dynamically creates an array of 10 components of type int and num contains the base address of the array

  Write a program that reads a string from the keyboard

Write a program that reads a string from the keyboard and then display all vowels contained within a user-input string. (Vowels are: a e i o u)

  Write a count occurrences() function that accepts a string

Write a CountOccurrences() function that accepts a string to be searched and a sub-string to be found. The function should return the # of times the sub-string is found. Write a tester file that declares a secret sentence as a constant.

  Wrtie a function called gen_rand_double_array

Wrtie a function called gen_rand_double_array that generates 900 samples of size 22500 random numbers from U(10, 12). For each of these 900 samples, write a main funciton that calculates the mean and finds the simulated probability that the mean is b..

  Write a program to find how much time takes to travel

Write a program C. An object is traveling "x" miles/second after every 2 minutes its current and speed is decreased by 1.7%. How much time it takes to travel "y" kilometers from its origin

  Review of object oriented software development methodologies

Review of Object Oriented Software Development Methodologies

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd