Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem statement The program should prompt the user to enter the length of an array. Once the length is provided, the program should then ask

Problem statement
The program should prompt the user to enter the length of an array.
Once the length is provided, the program should then ask the user to input that many
elements to fill the array. After the array is populated, the program should generate a
random variable to shuffle the order of the elements in the array. Finally, the program
should display the shuffled result of the array.
Array Length Limit
The maximum length of the array is limited to
MAX_LENGTH=100. Arrays exceeding
this size are not allowed.
Allowed Libraris
You can add your function in a cpp file.
However, you can only use #include iostream, random, vector !!!!!!!!!!!!
Input Format
Input is provided by using cin, and the result is displayed by using cout in Problem
The text is provided by keyboard typing.
The first line contains the length of an integer array.
The second line contains the elements of the array separated by spaces,
corresponding to the integer array entered on the first line.
Output Format
The first line outputs the shuffle order of the array separated by spaces.
The second line outputs the shuffled result according to the shuffle order of the
array entered on the first line.
Example Data
Sample Input:
Input the length of an array: 8
Input values: 163267534565442
Sample Output:
Shuffling Order:
3,1,4,5,2,6,7
Shuffling Result:
216753456365244
you should consider shuffling order. you should check input values according shuffling order.!
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions