Calculate an average of several integers entered by the user

Assignment Help Computer Engineering
Reference no: EM132194669

Write a C++ program that calculates an average of several integers entered by the user. It first prompts the user to enter the number of integers she wants to average, then allows the user to enter the integers one by one, then calculates and displays the result as a floating point number.

You must use an array to store the integers; use a loop to fill the array; write a separate function called "average()", which will be called from the main function, and to which the array and its size will be passed as two parameters. You will need to use a loop inside the average function, as well as cast an integer into a float to get a floating point result.

Reference no: EM132194669

Questions Cloud

Write a c program that compiles and runs without errors : Write a C program that compiles and runs without errors or warnings. This program has a bunch of little bit-manipulation functions in it.
Compute how many seconds are in 20 years : Write a C# program to convert one billion seconds (1,000,000,000 seconds) into years, months, days, hours, minutes, and seconds, using visual studio.
Calculate the gross pay of a set of employees : Calculate the gross pay of a set of employees. For each employee the program should prompt the user to enter the clock number.
Find increase in temperature for a thermally insulated chunk : Radioactive decay of granite and other rocks in Earth's interior provides sufficient energy to keep the interior molten, to heat lava, and to provide warmth.
Calculate an average of several integers entered by the user : Calculate an average of several integers entered by the user. It first prompts the user to enter the number of integers she wants to average.
Define and initializes three pointers : Display on the screen the addresses stored in those pointers each one in three different forms: octal, decimal and hexadecimal formats.
What are the two points of interest : A horizontal spring attached to a wall has a force constant of850 N/m. A block of mass 1.00-kg is attached to the spring andoscillates freely on a horizontal.
Define and initialize an integer and a floating point number : Write a C program that defines and initialize an integer and a floating point number and defines two pointers to point to those variables respectively.
Does the graph have asymptotes : Consider the formula for Centripetal Force, Fc=mv2/r, and predict the shape of a graph that plots Force vs Radius. Does the graph have asymptotes?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Discuss the steps that would be needed to extend polynomial

Discuss the steps that would be needed to extend the polynomial calculator so that it would process polynomials in several variables.

  Show your browser displaying an html file served

Using The WampServer, XAMPP, or MAMP, put some files in the appropriate folder (depends on the server) for serving by your webserver.

  Describe the computer the client

What questions should you ask and how should you proceed? Write a one- to two-page report describing the computer the client used, who else had access to it, and any other relevant facts that should be investigated.

  Write a code fragment that prints every other character

Write a method called multiplesOfFive that prints the first 5 multiples of 5 (starting with 5). The method takes no parameters and doesn't return anything.

  Write a function that converts an input of some integer

Write a function that converts an input of some integer number of nickels into outputs of integer numbers of dollars, quarters, and nickels. Do not write a main function. Your function does not do cin or cout.

  Information has many facets value confidentiality integrity

information has many facets value confidentiality integrity privacy legality and so on. all information is not the same

  How technologies aid such cross-cultural interchanges

How technologies (for example, Internet, YouTube, Facebook, and so on) aid or discourage such cross-cultural interchanges.

  Prepare a program that allows the user to pick a file

Write a program that allows the user to pick a file, doubles the red value of each pixel in the picture, and shows the picture.

  Prepare a business report comparing the three vendors

A list of the antivirus and firewall packages you researched. You should research and list at least three different antivirus and firewall packages.

  What would be the maximum bandwidth that could be used

An optical communications link is to be built using fiber rated for 5000 MHz-km. The light source is a laser diode producing 0.25 mW.

  Write a program that reads in two sparse matrices and stores

We are assuming that the matrices are too large to fit into memory as arrays, thus all calculations must be carried out with the matrices stored in their linked list format.

  Describing the hardware and software used to support

describing the hardware and software used to support personal workgroup and enterprise computing within your current

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