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
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.
|