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 a complete c++ program

The main program will read in a parameter value n (read this in main). Then it will call a function read2arrays (details below) to read lists of grades into two arrays, which the main program will call test1 and test2 (or some other names of your ..

  Program which converts fahrenheit to centigrade

Design, create, and test a program which converts degrees Fahrenheit to degrees Centigrade (Celsius). The program must contain one main program and 3 functions: F2C() and C2F() and instructions()

  Find answers of c programming questions

1. int main(void){ int height 3. 5; int width = 25: if(height == 5 && width == 25){printf("the height and width are correct: "); }return 0; }Assuming all libraries are included, what is the result of the code above when run?

  Write a program for a graphics system

Write a program for a graphics system that has classes for rectangles, squares, circles and triangles. Each of these must be derived from a base class

  Design-analysis-coding and testing

For this assignment you will be provided with incomplete sample starter code that you can modify and build upon. Your task will be to carry out the design, analysis, coding and testing to add several additional features to this sample code. You ar..

  Write a function named caesardecipher

Write a function named caesarDecipher that accepts a key value (the Caesar shift value) as its first command-line parameter, and a string (the ciphertext) for its second parameter. Your caesarDecipher function should look like this:

  What is the output of the corrected loop

What is the output of the loop as it is written and correct the syntax of the loop so that the logic of the corrected loop corresponds to the formatting of the original loop. What is the output of the corrected loop?

  Write a function to convert the two dimensional coordinates

Write a function to convert the two dimensional coordinates of a point from Cartesian system to polar system by using x and y as its parameters, returning r and using references to pass theta value.

  Local diner that allows customers to see the diner''s menu

Design a program to be used for a small local diner that allows customers to see the diner's menu and then make their meal selections using the program.The program will also calculate and print an itemized bill.

  Creating virtual computer using c programming language

I need help with creating virtual computer using c programming language, the program should exactly work like a real computer

  Write a recursive void function

Write a recursive void function called rot at eLeft that rotates the first n integers in an array to the left. To rotate n items left, rotate the first n - 1 items left recursively, and then exchange the last two items. For example, to rotate the ..

  While loop that allows the user to continue entering

This code should include a while loop that allows the user to continue entering employees as long as they want to continue:int main(){Real payrate,hours, gross,again;

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