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
Only one option acn be selected
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
Knowledge Booster
Similar questions
- Only one option can be selectedarrow_forwardCreate a program that reads three lines from a text file. Each line should be read one at a time. For each word on a line, the user should be asked to specify how many syllables are in that word. The program should then inform the user if the file contains a valid Hiku using the function below: def isHiku (firstLine, secondLine, thirdLine):if (firstLine == 5 and secondLine == 7 and thirdLine == 5): return True return False print("The file contains a Hiku:", isHiku(5,7,5))Note: You must replace the values in the function with the numbers counted by your program.arrow_forwardImplement function duplicate() that takes as input a string and the name of a file in the current directory and returns True if the file contains duplicate words and False otherwise. Hints: remember to save the function and the text file in the same directory. def duplicate(filename): 'Put in docstring’ # get file content infile = ________________# ______________ content = ______________# ______________ infile__________________# ______________ # replace punctuation with blank spaces and obtain list of words table = ________________________ # _______________ words = _______________________ # _______________ # for every word, check if it occurs more than once; if so, return True for word in words: if ______________________ # _____________ _________________# _____________ # no word occurred more than once, so return False ______________ Result of running the function. >>> duplicate('Duplicates.txt') True >>> duplicate('NoDuplicate.txt') Falsearrow_forward
- Introduction to Computer Systems Project 1 Due: February 09, 2023 by 5:00 PM Spring 2023 Introduction: xxd command in Linux creates a hex dump of a given file or standard input. It's simple. For example, suppose you have a text file 'test.txt' with contents as shown below: The isprint() function checks whether a character is a printable character or not. Check more information in: https://www.programiz.com/c-programming/library-function/ctype.h/isprint Here's how you can use xxd to convert the file contents into hex: $ xxd test.txt And here's the output: 00000000: 5468 6520 6973 7072 696e 7428 2920 6675 00000010: 6e63 7469 6f6e 2063 6865 636b 7320 7768 00000020: 6574 6865 7220 6120 6368 6172 6163 7465 00000030: 7220 6973 2061 2070 7269 6e74 6162 6c65 00000040: 2063 6861 7261 6374 6572 206f 7220 6e6f 00000050: 742e 0a43 6865 636b 206d 6f72 6520 696e 00000060: 666f 726d 6174 696f 6e20 696e 3a20 6874 00000070: 7470 733a 2f2f 7777 772e 7072 6f67 7261 00000080: 6d69 7a2e 636f 6d2f 632d 7072…arrow_forwardWritten in python only!arrow_forwardwordSort.py: Write a program that reads words from a file (filename given as a command-line argument) and prints them in (case insensitive) sorted order. For example, if the input file contains:If there's a problem yo I'll solve itCheck out the hook while my DJ revolves itIce ice baby The program should print (one word per line, compressed here for brevity):a baby Check DJ hook I'll Ice ice If it it my outproblem revolves solve the there's while yoarrow_forward
- Write a program that prompts the user for an input file name, reads all words from the input file, and writes the words to the output file sentences.txt. Start a new line whenever a word ends in a period, question mark, or exclamation mark. Complete the following file: sentences.cpp 1 #include 2 #include 3 #include 4 using namespace std; 5 6. int main() { cout > input_file_name; 7 8 <« endl; 10 11 12 13 14 return 0; 15 } Submitarrow_forwardIn Python IDLE Write a program that reads the file’s contents and determines the following: The number of uppercase letters in the file The number of lowercase letters in the file The number of digits in the file The number of whitespace characters in the file Then the program should do a mass replacement of all spaces with a ‘-‘, and then replace any uppercase letters with lowercase letters. After the replacement of the spaces, the count of letters, digits, and spaces should be rerun, the number of replacements indicated, and a second report of letters, digits and spaces should be printed. Save the results of the changes in a file named “testoutput.txt”. This file must be submitted as part of the submission for your lab. Output should look like this: Uppercase letters: 20 Lowercase letters: 310 Digits: 4 Spaces: 82 >>> Hint: This program does not need to use any lists – the entire file can be read into one string. Problem 2. Date Printer - Write a program…arrow_forwardPlease do this in Python: Write a program that allows the user to navigate lines of text in a file. The program should prompt the user for a filename, read the file and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line number range from 1 to the number of lines in the file. If the input is 0, the program quits. Otherwise, the program prints the text associated with that number.arrow_forward
- Write a program that reads student data from a file, compute their GPA and writes the results to a different file. 1. The user should have the option to either enter their text file that contains the student grades or use the provided text file that contains theinformation. The data in "indata.txt" should look similar to this, Lara_Croft75 70 91 69 89Chris_Redfield68 88 79 85 94Johnny_Cochran69 98 95 77 80Wanda_Maximoff84 86 98 95 92Luke_Skywalker74 96 80 98 97William_Kurt89 52 99 81 58Samuel_Jackson50 96 50 64 95END_OF_FILE This is supposed to be in python. This is what I have so far. I have no experience I apologise. I am trying to finish the GPA calculating program currently but am having trouble finishing it. grade = input("enter grades")points = 0 if grade is 90-99:total_points = 4.0if grade is 80-89:total_points = 3.0if grade is 70-79:total_points = 2.0if grade is 60-69:total_points = 1.0if grade is 50-59:total_points = 0.0gpa = total_points/len(grade)print(gpa,"is gpa")arrow_forwardAssume that infile has been properly defined to read data from a file and that a file of integers has been properly opened. If you don't know how many integers are in the file, which loop(s) would be appropriate to read in all the values from the file? Variable n has been defined as an int. 1. while(! infile.eof()) 2. for(int x = 0; x < 1000000; x++) 3. while(infile >> n) Answers: A. Both 2 and 3 B. 1, 2, and 3 C. Both 1 and 2 D. Both 1 and 3 E. 3 onlyarrow_forwardWrite a program that receives a filename as user input. The file is structured as multiple lines containing numbers separated by a single space.For example, this would be an acceptable file: 1 2 3 4 5 6 7 2 Your program should open this file and: print all its contents; write the median of all numbers to a new file called result.txt. IMPORTANT NOTES: the median is the element in the middle when you sort the values; the median of values (2, 1, 3) is 2, because when you sort them, you get 1, 2, 3, and 2 is the value in the middle. you can assume there will be no empty lines; there might be any arbitrary number lines in the file; there might be any arbitrary number of elements in a single line; you can assume there will always be an odd number of elements. Example 1: If input is: file1.txt and the contents of file1.txt are: 1 2 2 you should first print the content, and then write 2 to result.txt. Example 2: If input is: file2.txt and the contents of file2.txt are: 1 2 3 4 5 1 7 you…arrow_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