Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone help with the full code please. the output should look like the black screen. thank you for your help to whoever is helping

can someone help with the full code please. the output should look like the black screen. thank you for your help to whoever is helping me i been trying for the last 3 days. image text in transcribed
image text in transcribed
Recursion Implement recursive functions. 1. Write a recursive function compute Sum that will compute the sum of the first n integers in an array of at least n integers. Hint: begin with the nth integer. 2. Given two integers, start and end, where end is greater than start, write a recursive CH function sum that returns the sum of the integers from start through end, inclusive. 3. Write recursive functions: a. Revise the function writeBackward, discussed in Section 2.3.1, so that its base case is a string of length 1. b. Write a CH function that implements the pseudocode function writeBackward2, as given in Section 2.3.1. CPSC 150 Spring 2019 4. Given an integer n, m >0 and m>n, write a recursive CH function writeIntegers that writes the integers n, n+1, ..., m. 5. Write an integer n >0, write a recursive C++ function sumofSquares that returns the sum of the squares of 1 through n. 6. Write a recursive C+ function reverseDigits that writes the digits of a positive decimal integer in reverse order. 7. Write a recursive C++ functions a. WriteLine writes a character repeatedly to form a line of n characters each. For example, waiteunes *. 5) produces the line ***** Should use the function porotypes below //Function prototypes int, compute Sum (const int anArray[], int n); int sun(int start, int end); void writeBackward (string 3); void writeBackward2 (string 3); void writeIntegers (int n, int n); int sumofSquares (int n) ; void reverseDigits (int integer); void writeLine(char ch, int n); void writeBleck (char ch, int n, int n) ; Test your functions with followings: int, anArray[SIZE] = {1, 2, 3, 4, 5, 6, 7, 8}; Stining 3 = "cat"; Sample Run: 1. sun(anArray, 5) returns 15 2. sunc2, 5) returns 14 3. a. writeBackwards(s) returns tac 3. b. write Backwards2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions