CSCI 261 - Programming Concepts (C++)Fall 2017 - Lab 4BQuick Links: Canvas | CS @ Mines | Cloud9 | Piazza | zyBooks |
|
| Home | Contact | Syllabus | Assignments | Schedule | Resources | | |
This lab is due by Tuesday, October 10, 2017 11:59 PM . Instructions
This lab picks up right where Lab4A left off.
We are going to find the largest value in an array. After you have
printed out the values within the array, pass the array to a function
to find the max value.
The function should accept as input an array of any size and the size of the array as a separate parameter. The function should return as an int the largest value in the array. Inside the function, iterate through the array searching for the largest value in the array. Then print this value. (There are hints below if you need a starting point.) Then repeat the same process to create a function that finds the minimum value in the array. An example interaction follows:
Hey! Witness my first array mojo!
Enter 15 numbers and I will tell you what they are. Number 1: 8 Number 2: 6 Number 3: -7 Number 4: 5 Number 5: 3 Number 6: 2 Number 7: 4 Number 8: 1 Number 9: 3 Number 10: 13 Number 11: 32 Number 12: 14 Number 13: 25 Number 14: 51 Number 15: 9 So awesome! The numbers are: 8 6 -7 5 3 2 4 1 3 13 32 14 25 51 9 Have a nice day! The largest number is: 51 The smallest number is: -7 Gaze at my awesome.
If you are unsure how to get started, here are the suggested steps for
your function:
Functional Requirements
Lab Submission
You will submit your solution to this lab with the rest of A4.
Detailed instructions for doing this are posted in Assignment 4.
This lab is due by Tuesday, October 10, 2017 11:59 PM . | |
Last Updated: 09/28/17 12:18
|