(Create large dataset) Create a data file with 1,000 lines. Each line in the file consists of a faculty member’s first name, last name, rank, and salary. The faculty member's first name and last name for the ith line are FirstNamei and LastNamei. The rank is randomly generated as assistant, associate, and full. The salary is randomly generated as a number with two digits after the decimal point. The salary for an assistant professor should be in the range from 50,000 to 80,000, for associate professor from 60,000 to 110,000, and for full professor from 75,000 to 130,000. Save the file in Salary.txt. Here are some sample data:
FirstName1 LastName1 assistant 60055.95
FirstName2 LastName2 associate 81112.45
...
FirstName1000 LastName1000 full 92255.21
Want to see the full answer?
Check out a sample textbook solutionChapter 12 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: Early Objects (6th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Starting out with Visual C# (4th Edition)
Concepts Of Programming Languages
Digital Fundamentals (11th Edition)
Starting Out with C++: Early Objects (9th Edition)
- Modify below program to read dictionary items from a file and write the inverted dictionary to another file. Include the following: The input file for your original dictionary (with at least six items). The Python program to read from a file, invert the dictionary, and write to a different file. The output file for your inverted dictionary. Program:" # Constructing the dictionary with different types of keys and lists of valueshobbies_dict = {"Sports": ["Soccer", "Basketball", "Swimming"],"Music": ["Guitar", "Piano", "Singing"],12345: ["Reading", "Writing", "Drawing"]}# Printing the original dictionaryprint("Original Dictionary:")print(hobbies_dict)# Function to invert the dictionarydef invert_dict(d):inverse = dict()for key in d:values_list = d[key]for value in values_list:if value not in inverse:inverse[value] = [key]else:inverse[value].append(key)return inverse# Running the modified invert_dict function on the dictionaryinverted_dict = invert_dict(hobbies_dict)# Printing the…arrow_forwardShow two different ways to reset the file position pointer to the beginning of the filearrow_forwardFinish the C++ code. Suppose the file nums.txt contains the following data:arrow_forward
- Which INT 21h function would you call if you wanted to make a file read-only?arrow_forwardQUESTION 4 Use the following file to predict the output of the code A. aaa B. ddd C. ccc D. errorarrow_forward- In C++ using Visual Studio - Seperate the files if there is any .cpp, .main or .h files. PART 1Read the contents of the text file and store them in a C++ data structure called std::map<string, int>This map is a collection of sorted <key, value> pairsIn this case, the keys are unique words found in the text file, and the values represent the number of times each word appearsFor example, since the word "cat" appears twice in the file, then map["cat"] = 2 PART 2Iterate through the map and print each key in the order they appearThis will give you a sorted list of unique wordsHere's the expected result: "a big cat does everything feeding goats helping injured juvenile kangaroos locating missing notorious objects playing quietly reading superb tales upvoting videos with xylophone yielding zebras" PART 3Iterate through the map again, this time printing each associated valueThe values represent how many times each word was found in the text filePay attention to the sequence of…arrow_forward
- Do not read directly from the example files, as the automated testing system expects you to read from the standard input. Instead, process the lines as follows: 3 - Geography Grades 3 Make a copy of your program for the problem Geography Grades 2 and change the code in such a way that your program can process multiple groups. These groups are on the input separated by ’=\n’. Every group starts with a first line that contains the name of the group and the lines after contain the information about the students in the same way as is specified for the problem Geography Grades 1. With the input 1bErik Eriksen__________4.3 4.9 6.7Frans Franssen________5.8 6.9 8.0=2bAnne Adema____________6.5 5.5 4.5Bea de Bruin__________6.7 7.2 7.7Chris Cohen___________6.8 7.8 7.3Dirk Dirksen__________1.0 5.0 7.7 The output should be: Report for group 1bErik Eriksen has a final grade of 6.0Frans Franssen has a final grade of 7.0End of reportReport for group 2bAnne Adema has a final grade of 6.0Bea de Bruin…arrow_forwardDo you know what happens when you call the out function on your own to open a file when it doesn't exist?arrow_forwardUsing C++, write a fragment of code to open a file called random.txt. If the file does not exist, create and open it for both input and output. Then, write 10 consecutive random numbers in the range of 1 to 10 into the filearrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education