Write a program that calls a function calculatesum

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

Please use c++ language only and a for loop within the function that calculates the sum.

Question : Write a program that calls a function calculateSum to calculate the sum of Nintegers. The function calculateSum has one parameter n of type integer and returns an integer which represents the sum from 0 to N, inclusive.

After calculating the sum of this N numbers write a function that calculate the average. This function will have three parameters: the sum, the number of items and the average.

This function should calculate and return the average through one of its parameters (passing parameters by reference).

The main function should be responsible for all print-outs. In other words, your functions will only calculate and return the values and NOT print anything.

Reference no: EM132100935

Questions Cloud

Write a function called highestpay that takes an array : Write a function called highestPay that takes an array of Employees like the one above and prints out the name of the employee with the highest salary.
Calculate the project adjusted present value : If the ?rm's tax rate is 34%, calculate the project's adjusted present value (APV)
Devaluation of the nominal exchange rate : How the effects of a devaluation of the nominal exchange rate with the monetary approach in a fixed exchange rate regime compare with effect in the IS-LM
Find the height from which the rock was launched : A rock thrown with speed 11.5m/s and launch angle 30.0 degrees (above the horizontal) travels a horizontal distance of d = 15.5m before hitting the ground.
Write a program that calls a function calculatesum : Write a program that calls a function calculateSum to calculate the sum of Nintegers.
Draw a line on the graph representing total energy of ball : A 1.00 kg ball is thrown directly upward with an initial speed of 16.0 m/s. A graph of the ball's gravitational potential energy vs. height, Ug(h).
Five basic skills your customer service representative : "Five Basic Skills Your Customer Service Representative Cannot Live Without."
Appeal involves claim for workmen compensation benefits : This appeal involves a claim for workmen’s compensation benefits for the period during which the claimant was incapacitated by severe depression caused
Develop a daily production schedule for the buffalo plants : Formulate a linear programming model that can be used to develop a daily production schedule for the Buffalo and Dayton plants.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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