Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 22. What is the difference between the set and multiset STL classes in Chapter 3? Group of answer choices The multiset class allows duplicate values in the container, whereas the set class requires unique values. The multiset class allows unique values in the container, whereas the set class requires duplicate values . The multiset class allows duplicate and unique values in the container, whereas the set class requires duplicate values. The multiset class allows duplicate values in the container, whereas the set class requires unique and duplicate values. They are using different name but identical .arrow_forwardPlease help write the functions (context for the problem in the images): write_X_to_map(filename, row, col): Takes as inputs a string corresponding to a filename, and two non-negative integers representing a row and column index. Reads in the map at the given filename, inserts an X into the given row and column position, then saves the map to a new file with 'new_' prepended to the given filename. You can assume the filename given to the function as argument refers to a file that exists.arrow_forwardwrite in c++Write a program that would allow the user to interact with a part of the IMDB movie database. Each movie has a unique ID, name, release date, and user rating. You're given a file containing this information (see movies.txt in "Additional files" section). The first 4 rows of this file correspond to the first movie, then after an empty line 4 rows contain information about the second movie and so forth. Format of these fields: ID is an integer Name is a string that can contain spaces Release date is a string in yyyy/mm/dd format Rating is a fractional number The number of movies is not provided and does not need to be computed. But the file can't contain more than 100 movies. Then, it should offer the user a menu with the following options: Display movies sorted by id Display movies sorted by release date, then rating Lookup a release date given a name Lookup a movie by id Quit the Program The program should perform the selected operation and then re-display the menu. For…arrow_forward
- Write a function named repeat_words that takes two string parameters: 1. in_file: the name of an input file that exists before repeat_words is called 2. out_file: the name of an output file that repeat_words creates Assume that the input file is in the current working directory and write the output file to that directory. For each line of the input file, the function repeat_words should write to the output file all of the words that appear more than once on that line. Each word should be lower cased and stripped of leading and trailing punctuation. Each repeated word on a line should be written to the corresponding line of the output file only once, regardless of the number of times the word is repeated. For example, if the following is the content of the file catInTheHat.txt: Too wet to go out and too cold to play ball. So we sat in the house. We did nothing at all. So all we could do was to Sit! Sit! Sit! Sit! The following function call: inF = 'catInTheHat.txt' outF =…arrow_forwardWrite the code segments based on the given descriptions: Declare a file pointer called input. Open a file called location.txt for reading using this pointer. If the file is not available, display “File does not exist.”. The content of the text file location.txt is as shown below. It includes the location, latitude and longitude values. FILE location.txt CONTENTS <Location> <Latitude> <Longitude> UTM 1.5523763 103.63322 KLCC 3.153889 101.71333 UM 3.1185 101.665 UMS 6.0367 116.1186 UNIMAS 1.465174 110.4270601 Ask the user to enter a location. Check if the user’s location can be found in the text file. If found, display the location, latitude and longitude as shown below. SAMPLE OUTPUT Enter a location: UM Location : UM Latitude : 3.1185 Longitude : 101.6650 Otherwise display “Sorry, location could not be found”. SAMPLE OUTPUT Enter a location : MMU Sorry, location could not be foundarrow_forwardCode in python. Assume the variable dct references a dictionary. Write code that pickles the dictionary and saves it to a file named mydata.dat.arrow_forward
- Complete the following sentence. If more than one function is present in a file, the top function is a normal or function, while the ones below it are called local functions.arrow_forwardcreateDatabaseOfProfiles(String filename) This method creates and populates the database array with the profiles from the input file (profile.txt) filename parameter. Each profile includes a persons' name and two DNA sequences. 1. Reads the number of profiles from the input file AND create the database array to hold that number profiles. 2. Reads the profiles from the input file. 3. For each person in the file 1. creates a Profile object with the information from file (see input file format below). 2. insert the newly created profile into the next position in the database array (instance variable).arrow_forward5. In lab12_p5.py a function read_data_file has been created. This function takes in one string parameter that represents the name of the file to be processed. This function reads data from the provided file and returns a dictionary representation of the data stored in this file. The data file is a comma-separated file with the following columns: • County name • Tons of coal produced in 1900 • Tons of coal produced in 1910 © Run Online (1) zbessant Bessant lab12_p1.py x lab12_p5.py x lab12 p3.pyx lab12_p2.py x coal production. 1 # Problem #5 2 3 4 5 6 7 8 # Read the contents of a coal data file and return the data in a dictionary format. def read_data_file(filename): data file open(filename, "r") header_line = data_file.readline () # Read the header line of the file to extract years years = header_line.strip().split(",")[1:] # Extract the years from the header line Tons of coal produced in 1920 9 10 Tons of coal produced in 1930 11 # Initialize an empty dictionary to store the data…arrow_forward
- DescriptionWrite 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_forwardPart 1: Define a class named ID Protected Data Member: number - type int pointer (dynamic variable) number has to be 10 digits integer. Appropriate accessor and mutator functions. Default constructor and one argument constructor. Overload the insertion operator > to input ID objects. Add big three to ID class. Please indicate call of big three. Use following main() to test your class. int main(){ ID a(12345678); cout>a; cout>a; cout copy constrcutor is called Enter id number: 1234 ID number: 1234 ID => Assignment operator is called Enter id number: 56789 ID number: 56789 ID number: 12345678 ID number: 1234 ID => Destructor is called ID => Dest ructor is called ID => Destructor is calledarrow_forward7. The college has a file courses.txt. It contains the following details on how many students each course has. It is structured as shown below:- Maths, 150 Statistics, 36 Programming, 32 Write a Python program that reads the above file and enters the data into a dictionary. An example of the dictionary would be as below:- courses = {'Maths': 150, 'Statistics': 36, 'Programming': 32} The program should then do the following:- a. Ask the user to enter a name of a course. The program should output the number of students on that course. b. It should also allow the user to input additional courses with their student numbers. This should update the dictionary and the courses.txt filearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education