Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ please Define 2 functions that work with c-style arrays of integers. The first function should be called find Min and it should pass

in c++ pleaseimage text in transcribed

Define 2 functions that work with c-style arrays of integers. The first function should be called find Min and it should pass in an array of integers. The function should return the value of the smallest integer within the array. The second function should be called scale and it should pass in an array of integers and a single integer value. The scale function should reduce all values in the array by the single integer value passed in. For example, if the array passed in to scale originally stores the values 1 2 3 4 5 6 and the integer passed in is 1 then after the function call the array would store the values 0 1 2 3 4 5 In the main function: Read in integer values from cin and store them in the array until the user enters a -1. Output the values in the array, each value in the array separated by a space. Call the findMin function to get the smallest value in the array. Call the scale function, passing in the array and the value returned by findMin. Output the values in the array again showing that the array has been changed appropriately. Do not prompt the user for input. Just read the values in to the array. You may assume there will never be more than 50 integers read in

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

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions

Question

4. Develop a self-directed learning module.

Answered: 1 week ago

Question

2. Provide recommendations for effective on-the-job training.

Answered: 1 week ago