Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ Programming Exercise Write a program that creates an array with nine integer numbers. The program will display the largest number. Modify the program

In C++image text in transcribed

Programming Exercise Write a program that creates an array with nine integer numbers. The program will display the largest number. Modify the program so that it generates an array of nine integers randomly between 1- 100, then display its largest number. // main module Module main() // Declare a constant for the array size Constant Integer SIZE = 9 // Declare an integer array Declare Integer numbers[SIZE] -1, 2, Declare a variable to hold the largest number Declare Integer large // Find the largest number Set large = finaMax (numbers, 1, SIZE) // Show result Display "Largest number,large End Module // The findMax function accepts an array // and returns the largest value in the array. Function Integer findMaxInteger array[l, Integer start, Integer end) Declare Integer answer If start-= 1 then End If Set answer = array [start] If start > end then Return answer If arrayIstart] > ansier then End If else Set answer = array[start] Return findMax(array, start + 1, end) End If End Function

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_2

Step: 3

blur-text-image_3

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

Beginning PostgreSQL On The Cloud Simplifying Database As A Service On Cloud Platforms

Authors: Baji Shaik ,Avinash Vallarapu

1st Edition

1484234464, 978-1484234464

More Books

Students also viewed these Databases questions