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

  Code should include a loop that displays income

This code should include a loop that displays income generated from ticket sales for each night. Shows are performed on Thursday, Friday and Saturday nights.

  Write program that stores the numbers in array

Write a c++ program that stores the following numbers in the array named miles: 15,22,16,18,27,23, and 20. have your program copy the data stored in miles to another array.

  Write a small program to simulate a raffle

Write a small program to simulate a raffle (a gambling game) for a group with 100 members. You can simply identify each member with a no-duplicated ID numbers from 01 to 100. A number ticket with a positive 4-digits integer number will be randomly cr..

  Called cbankaccount

Create a base class, called CBankAccount, and two additional classes (each derived from CBankAccount), called CSavingsAccount and CCheckingAccount.

  Write a program to print out 30 real random numbers

Write a program to print out 30 Real Random Numbers with specific limitation (e.g. the real random numbers should be the real number between min=11.1 to  max=222.2).

  Program to find the factors

Write a c++ program to find the factors of an integer (entered by the user) which are themselves squares.

  Write a c program that converts celsius temperatures to

write a c program that converts celsius temperatures to fahrenheit temperatures.the formula isf95c 32.f is fahrenheit

  Write a function sum3darray

Write a function sum3DArray. This function will take a three dimensional array of ints and add all the entries in the three dimensional array. Assume columns and rank are two constants already defined.

  Sockets for this problem you will implement a client-server

sockets for this problem you will implement a client-server version of the rock-paper-scissors-lizard-spock game which

  Exponent and significant of a floating point

Write a program that requires the number of bits for the exponent and significant of a Floating Point representation; then requires two decimal real numbers and an operation either sum, subtraction or multiplication.

  Prepare the program to calculate the future investment value

Write a C++ program that reads in investment amount, annual interest rate, and number of years in this order, and displays the future investment value using the subsequent formula:

  Assignment 1 boxing amoebadevelop a two dimensional

assignment 1 boxing amoebadevelop a two dimensional interactive game with the following features1.use opengl any

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