Sorting Project 1/3 (C++ Programming) Data Structures
I need to know what are the three function codes for this project. I need three functions to generate 30 files.
Write three functions that each generate 10 unique dataset files of integers separated by a comma ",".
E.g., 34, 32421, 124124, 67, 92, ...
The sizes of these 10 datasets are (n) – 1000, 4000, 8000, 10000, 40000, 80000, 100000, 400000, 800000, 1000000.
One function should generate random integers between 0 to 1,000,000 as the elements of each dataset. Another function should generate a file with a sorted list of integers from smallest to largest. The final function should generate a file with a reverse sorted list with values going from largest to smallest.
E.g., 1000Sorted file will have 0 to 999, 1000Reverse.txt will have 999 to 0, and 1000Random.txt will have random numbers between 0 to 1,000,000.
These functions should not take any input arguments and should have the signature: void GenerateSortedInputFiles(), void GenerateRandomInputFiles(). void GenerateReverseInputFiles().
The output of these functions is just a print statement to console that file generation completed. The files names should have the format “SampleSize” + “Random/Sorted/Reverse” + “.txt” eg. “80000Sorted.txt”.
Submit a folder within which you need to have all your code files, README file with the compile and execution instructions, and your pre-compiled ".exe" executable files. On top of all the files, you need to mention your name as comments. All submitted code C++ files and header files must be named as "<your-name>_<sort-name>"
1. In the end, what should my code do?
It should create a set of 30 different files with a set of integers. 10 are sorted smallest to largest. 10 are largest to smallest (reverse). And 10 have random values (having duplicate values does not matter in this case). The amount of integers is determined by the name of the file. "8000Sorted.txt" contains 8000 integers from 1 to 7999 (or 0 - 8000) sorted from smallest to largest. These functions should have no input.
2. Should the two sorted functions be sorting the output of the random function?
No, this part of the assignment is just for creating input for the next part. There is no need for any sorting
3. Should the random function just create 10 datasets of the same size but different values?
No, the random function should create 10 datasets that each have different sizes. The possible values that are in these files should be from 1 to 1,000,000, it does not matter if they are unique.
- Define three functions named GenerateRandomInputFiles(), GenerateSortedInputFiles(), and GenerateReverseInputFiles(). These functions should not take any input arguments and should have a return type of void.
- Inside the GenerateRandomInputFiles() function, loop 10 times to generate 10 different dataset files. Each dataset file should have a different number of integers. The dataset sizes are: 1000, 4000, 8000, 10000, 40000, 80000, 100000, 400000, 800000, and 1000000.
- For each dataset size, generate a new dataset file named "SampleSize" + "Random" + ".txt". For example, for a dataset size of 8000, the file should be named "8000Random.txt".
- Inside the loop, open the file in write mode using std::ofstream, generate a new random integer between 0 and 1,000,000 for each element in the dataset, and write each integer to the file separated by a comma ",".
- After all elements have been written to the file, close the file and print a message to the console that file generation is complete.
- Repeat steps 2-5 for the GenerateSortedInputFiles() and GenerateReverseInputFiles() functions. For GenerateSortedInputFiles(), generate a sorted list of integers for each dataset file from smallest to largest. For GenerateReverseInputFiles(), generate a reverse sorted list of integers for each dataset file from largest to smallest.
Step by stepSolved in 5 steps with 5 images
- Computer Science csv file "/dsa/data/all_datasets/texas.csv" Task 6: Write a function "county_locator" that allows a user to enter in a name of a spatial data frame and a county name and have a map generated that shows the location of that county with respect to other counties (by using different colors and/or symbols). Hint: function(); $county ==; plot(); add=TRUE.arrow_forwardDescriptionWrite a program to compute average grades for a course. The course records are in a single file and are organized according to the following format: each line contains a student's first name, then one space, then the student's last name, then one space, then some number of quiz scores that, if they exist, are separated by one space. Each student will have zero to ten scores, and each score is an integer not greater than 100. Your program will read data from this file and write its output to a second file. The date in the output file will be nearly the same as the data in the input file except that you will print the names as last-name, first-name; each quiz score, and there will be one additional number at the end of each line:the average of the student's ten quiz scores.Both files are parameters. You can access the name of the input file with argv[1]. and the name of the output file with argv[2].The output file must be formatted as described below: 1. First and last names…arrow_forwardCreate a simple python sort program with the functions name: sort(), sum_of_list(), and list_max and one more function Requirements: 3 Functions in a separate module file a. Atleast 4-5 Parameters / arguments used b. Return values used 2. Main file created a. Main function created b. Main function used appropriately 3. Decision structure used 4. Repetition structure used 5. Comment/header/style 6. Purpose of code is clear / program has a clear purpose 7. Must Include a menu in the program 8. Use of atleast 3-4predefined modules for example (math/random) .arrow_forward
- Analyze the problems carefully. Create the programs of the following. 1. Ages and Stages (Fle name: Age_Lastname) Create a program that checks as to which stage an age is. Use the table below. Age 5-12 years Stage Grade-schooler 13-17 years Теen 18-21 years Young adult 2. LRT-2 Single Journey Fare Matrix (File name: LRT_Lastname) Create a program that displays the fare based on the entered destination. The starting station is Araneta-Cubao. Use the table below. Use the code destination to shorten the user's input. Destination Fare Recto (Re) J. Ruiz (Jr) Gilmore (Gi) PHP 20 PHP 15 PHP 10arrow_forwardI need help on my python assignmentarrow_forwardmatlabarrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY