Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(In C++) Write a program that takes in two command line arguments, generates an array of random numbers, and finds the minimum and max values

(In C++) Write a program that takes in two command line arguments, generates an array of random numbers, and finds the minimum and max values in the array. write a program that takes in the number of integers to generate as well as a maximum value for the random number generator. then, after populating the array with that many random numbers, your solution should output the value and index position of the minimum and maximum values in the randomly generated array.
image text in transcribed
Your program should take in the number of integers to generate as well as a maximum value for the random number generator. Then, after populating an array with that many random numbers, your solution should output the value and index position of the minimum and maximum values in the randomly generated array. Sub-task 0: using the handout from the lab monitor, sketch out your program solution in pseudo-code first. Sub-task 1: after writing your solution in pseudo-code, write a C++ program that implements your solution: Criteria This exercise is worth 10 pts: 5 pts for the solution and 5 pts for the program. Turn in your written algorithm to your lab monitor before leaving the lab, and make sure to mail your program to the lab monitor as well. . You can assume a maximum array size of 1 million. Use random seed value of 135 Your program should run as follows (to generate an array of . 200000 integers between 1 and 1 million): $ g++ lab9.cpp $./a.out 200000 1000000 Min is 5 at position 49657 Max is 999983 at position 88072 Hint: use a named constant for the aforemention ed maximum size assumption, and then use a sepa rate variable to store the actual number of ite ms passed in via the command line

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

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions