
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Objective: Make some simple program changes.
The examples in class were not very easy to use since a user had to guess at what to do to use the program. Change the program findminArrays.cpp to make it easier to use.
Any mixture of variables and text string can be included, but you must place the “<<” symbols between them.
Also modify the cout statement that displays the minimum value so that it also labels the number it prints. So if minimum were -5, rather than just displaing the number, the program should display:
minimum: -
a. Assume they will always enter fewer than 100, so you need to change the size of the array accordingly.
b. You will need to introduce a new variable to store this size. This variable should be used in the for loops to determine home many times the loop executes.
c. You need to correct the comments in the program so that they describe your new program.
d. You need to add a line in the first set of comments to include your name as programmer, such as:
// Programmer:
e. Add code to the program so that it also find the maximal value. You will need a new variable for this. You will also need to add new if statements, similar to those for minimum, to find the maximal value. You will also need to add a cout statement to display the maximal value. Similar to 1 above, include a label with the number.