Improvemented program

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

What does this program do and would you improve it?

//What does this program do?

#include <iostream>

using std::cout;

using std::endl;
int whatIsThis ( int [], int); //function protoype
int main()
{

const int arraySize = 10;

int a [arraySize] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int result = whatIsThis (a,arraySize);
cout << "Results is " <<result << endl;

return 0; //indicates successful termination

} // end main
//What does this function do?

int whatIsThis ( int b[], int size)

{

if (size == 1) // base case

return b [0];

else // recursive step

return b [size-1]+ whatIsThis (b, size - 1);

} // end function whatIsThis

Reference no: EM13762120

Questions Cloud

What is the act''s major significance : What difficulty is presented when an insanity defense is pleaded? How as this affected by the 1984 Insanity Defense Reform Act? What was the catalyst for passage of this Act, and what is the Act's major significance?
Terrie moffitt''s two-path biosocial theory of criminality : How do societal expectations, in combination with early-age biological maturity, contribute to the possibility of juvenile delinquency? According to Terrie Moffitt's two-path biosocial theory of criminality, why do some juvenile delinquents become li..
Define what is displayed on a computer screen : Computer users may encounter situations in which they can best express a computer-related problem or solution by showing the audience a graphic or video representation of what is displayed on a computer screen.
Dilutive eps of wonderful incorporation : The common stock of the company is selling in the stock exchange at $10 each. If Wonderful has 29,000 shares of common stock outstanding throughout the year and its Net Income is $12,000 after paying the preferred dividends, what will be the dilut..
Improvemented program : What does this program do and would you improve it?
Applications of the scientific method : Evaluate (XTATB), (BTB), and (BTB - XTATB).
How can we maintain anonymity and confidentiality : How can we maintain anonymity and confidentiality in the research process? What does it mean to maintain voluntary informed consent? What is a freedom from risk of harm?
Prepare an office memorandum : You are a paralegal working in Plentibux & Moore, a boutique Richmond, Virginia law firm that specializes in white-collar criminal defense. The senior partner in the firm, Bob Plentibux calls you in to his office and tells you that he has a hot issue..
Think of situations when organization development : Can you think of situations when Organization Development (OD) values might be appropriately violated in a consulting engagement?

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