![ander67061](/avatars/17492.jpg)
ander67061
28.12.2019 •
Computers and Technology
Using the rand () function, fill 5 arrays of integers with the same 10 random numbers. these numbers should be values between 1-100. the arrays should hold 10 integers and named; bubblearray, selectionarray, insertionarray, quickarray, and mergearray.
2. you should use the: a. bubble sort function to sort the bubblearray b. selection sort function to sort the selectionarray c. insertion sort function to sort the insertionarray d. quick sort function to sort the quickarray e. merge sort to sort the mergearray each unsorted array should be outputted to a file name assignment2results followed by the sorted version of the array and the time taken to sort the array to the same file.
using c++
how do i edit below to fit the requirements mentioned atop?
current code:
#include
#include
#include
#include
using namespace std;
int main()
{
int i, j, n=10, temp;
int bubblearray [n];
int selectionarray [n];
int insertionarray [n];
int quickarray [n];
int mergearray [n];
srand (time(null));
for (i = 0; i < 10; i++)
{
int value = rand() % 100 + 1; // random from 1 through 100
bubblearray [i] = value;
selectionarray [i] = value;
insertionarray [i] = value;
quickarray [i] = value;
mergearray [i] = value;
cout < < "this is the randomly generated list for bubblearray: ";
cout < < bubblearray[i] < < " ";
}
cout < < "\n";
cout < < "\nthis is the list after being sorted by the bubble sort method: ";
i = 0, j = 0;
system("pause");
return 0;
}
Solved
Show answers
More tips
- A Animals and plants Want a Perfect Lawn? Learn How to Plant Grass the Right Way...
- A Animals and plants How to Properly Care for a Pet Decorative Rabbit at Home?...
- C Computers and Internet How to Check the Speed of My Internet?...
- H Health and Medicine 10 Ways to Cleanse Your Colon and Improve Your Health...
- W Work and Career How to Write a Resume That Catches the Employer s Attention?...
- C Computers and Internet Е-head: How it Simplifies Life for Users?...
- F Family and Home How to Choose the Best Diapers for Your Baby?...
- F Family and Home Parquet or laminate, which is better?...
- L Leisure and Entertainment How to Properly Wind Fishing Line onto a Reel?...
- L Leisure and Entertainment How to Make a Paper Boat in Simple Steps...
Answers on questions: Computers and Technology
- C Computers and Technology A derived class has access to . a. the public functions and variables of its ancestor classes. b. the private functions and variables of its ancestor classes. c. only the...
- S Social Studies In open operations A. If the Fed wants to increase the money supply, it can bonds in open-market operations. B. If the Fed reduces the reserve requirement, the money supply...
- M Mathematics Consider three equal sources m in a triangular configuration: one at (a/2, 0), one at (−a/2, 0) and one at (0, a). Plot the streamlines for this flow use Matlab. Are there...
- B Business A shoe manufacturer has created a decision tree with costs of different marketing strategies and the two possible outcomes from each strategy. What other data does the company...
- B Business Spanish Peaks Railroad Inc. is considering acquiring equipment at a cost of $1,250,000. The equipment has an estimated life of eight years and no residual value. It is expected...
- P Physics A double slits separated by 0.0580 mm is located at a distance of 1.50 m from a screen. (a) If yellow light of wavelength 588 nm strikes the double slit, what is the separation...
- S Social Studies Need help coming up with a title for my essay It s about the importance of the American Declaration of Independence, and why it was an important turning point in American...
- B Business In a simple, closed economy (no government or foreign sector), disposable income increases from $2,000 to $3,000. If consumption increases from $1,500 to $2,100, the marginal...
- B Biology A 28-year-old female patient is returning to her provider’s office with complaints of RLQ pain and heartburn with a temperature of 100.2. The provider performs a detailed...
- M Mathematics G A programmer plans to develop a new software system. In planning for the operating system that he will use, he needs to estimate the percentage of computers that use a new...
Ответ:
It allows you to see the interpreter’s algorithm.
Explanation:
REPL stands for Read-Evaluate-Print-Loop, and it is an interactive CLI Interpreter Shell. It works in the way as it is stated. The first task it does is to read through the expression which is provided as input on the Scala command line and after that it evaluates the expression and final print the expression outcome on to the screen, and after that it again becomes good enough to read and this happens in loop. And in the current scope, the previous outcomes are imported automatically. It reads through the expression in interactive mode at the prompt, and then it wraps all into a template which is executable, and then it does the compiling and finally it executes the result. Hence, the third option is correct but the rest of the options are not correct.