Design a modular program which asks the user to enter a list of numbers. The numbers must be stored in an array. The program then finds the index of the first occurrence of the smallest element in the array and the last occurrence of the largest element in the array. The program displays the position and value of each of these items. Rather than processing items as they are read in as we have done so far, this program is asking you to read all the data into memory and then do the processing. Your design should contain a minimum of two functions. The first function takes as input the array and returns the indexof the location of the first occurrence of the smallest item. The second function takes the array as input and returns the index of the location of the last occurrence of the largest item in the array. Your functions do not need to return the highest and lowest data values since having the index is all that is needed to access the values. Do not display the highest and lowest values inside thefunctions. Use the index returned from the functions to display the values in the main function.   C++

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 16PE
icon
Related questions
Question

High and Low Project

Design a modular program which asks the user to enter a list of numbers. The numbers must be stored in an array. The program then finds the index of the first occurrence of the smallest element in the array and the last occurrence of the largest element in the array. The program displays the position and value of each of these items.

Rather than processing items as they are read in as we have done so far, this program is asking you to read all the data into memory and then do the processing. Your design should contain a minimum of two functions. The first function takes as input the array and returns the indexof the location of the first occurrence of the smallest item. The second function takes the array as input and returns the index of the location of the last occurrence of the largest item in the array. Your functions do not need to return the highest and lowest data values since having the index is all that is needed to access the values. Do not display the highest and lowest values inside thefunctions. Use the index returned from the functions to display the values in the main function.

 

C++

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning