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.
Step by stepSolved in 3 steps with 5 images
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
- Write a program that reads the scores from numbers.txt a line at a time and displays their total and average. Since you don’t know how many scores, you will need to keep looping until readline is blank. numbers.txt is a file that contains a list of scores. numbers.txt 10 25 36 45 89 42 54 create a program that reads the scores from numbers.txt file one line at a time. The program should display their total and average. since the number of scores is unknown, the program must keep looping until readline is blank. Please write as simple as possible and use good variables. Thank you. Sample Output: There are 7 scores The total is 301 The average is 43.0arrow_forwardWrite a program that first reads in the name of an input file and then reads the file using the csv.reader() method. The file contains a list of words separated by commas. Your program should output the words and their frequencies (the number of times each word appears in the file) without any duplicates. Ex: If the input is: inputl.csv and the contents of input1.csv are: hello, cat,man, hey, dog, boy, Hello, man, cat,woman, dog, Cat, hey, boy the output is: hello 1 cat 2 man 2 hey 2 dog 2 boy 2 Hello 1 woman 1 Cat 1 Note: There is a newline at the end of the output, and input1.csv is available to download. 339092.2126252.ax3zav7arrow_forwardWrite a program called asyncFileCount.js that prints the number of files with a given extension in a given directory. The first argument will be the path to the directory we want to filter on (e.g. /path/to/dir/') and a file extension to filter by as the second argument. For example, if you get '.txt' as the second argument then you will need to filter the list to only files that end with .txt Below are some example runs: An example run would be: node asyncFileCount.js . .js Another example run would be: node asyncFileCount.js /Users/jalirani/Desktop .docxarrow_forward
- Copy and paste the numbers below into a notepad file. save as "unformatted.txt" Next Start with "unformatted.txt", which as its name implies, is an unformatted list of numbers. When reading the file, ignore the first line, which contains the word "Start". Read all the values into a numerical list. Using the NumPy library, calculate the average and standard deviation of the values. Write all the values to an output file named "output.txt" in tabular format. Use formatting of 11 spaces and 4 decimal places per number. After the table, write a blank line, then the average and standard deviation. Start 100.4040 130.3332 161.1498 145.0063 136.2653 127.8121 143.7642 120.9116 198.3982 146.3610 186.3373 147.6797 162.9832 182.3953 181.5605 109.9044 177.2394 169.0383 154.3357 164.2510 134.9555 198.1187 181.9601 132.5095…arrow_forwardpython: Open the file mbox-short.txt and read it line by line. When you find a line that starts with 'From ' like the following line:From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008 You will parse the From line using split() and print out the second word in the line (i.e. the entire address of the person who sent the message). Then print out a count at the end. Hint: make sure not to include the lines that start with 'From:'. Also look at the last line of the sample output to see how to print the count. You can download the sample data at http://www.py4e.com/code3/mbox-short.txt my code: fname = input("Enter file name: ")if len(fname) < 1: fname = "mbox-short.txt" fh = open(fname)count = 0 print("There were", count, "lines in the file with From as the first word")arrow_forwardWrite a program that first reads in the name of an input file and then reads the file using the csv.reader() method. The file contains a list of words separated by commas. Your program should output the words and their frequencies (the number of times each word appears in the file) without any duplicates. Ex: If the input is: input1.csv and the contents of input1.csv are: hello,cat,man,hey,dog,boy,Hello,man,cat,woman,dog,Cat,hey,boyarrow_forward
- can you do it pythonarrow_forwardWrite a program to draw a quiz score histogram. Your program shouldread data from a file. Each line of the file contains a number in the range0-10. Your program must count the number of occurrences of each scoreand then draw a vertical bar chart with a bar for each possible score (0-10) with a height corresponding to the count of that score. For example,if 15 students got an 8, then the height of the bar for 8 should be 15.Hint: Use a list that stores the count for each possible score. An examplehistogram is shown below: o o D D0 1 2 3 4 5 6 7 8 9 10arrow_forwardpython Write a function that reads in a text file, and counts the number of times each word occursin the file. Then print the words alphabetically with its corresponding count. Each word willbe separated by a space or newline, but there is no guarantee that each word will be on aseparate line.arrow_forward
- Create a file with given numbers. Read them from file with a python program andcalculate mean, median, variance and standard deviation for this data.Mean, Variance, Standard Deviation,Here μ = = Mean900 932 298 918 645 505 922 324 979 360 775 53 12 986 764 400 81 923 233 450897 166 787 148 376 385 49 62 149 618 568 270 52 295 278 705 942 341 365 74 538604 958 816 634 566 216 919 475 988 732 835 200 741 587 910 183 204 684 349373 29 503 63 217 213 656 416 350 386 257 827 820 807 369 634 185 690 255 312380 449 564 615 966 342 153 425 830 365 347 487 550 788 959 79 129 666 115 27arrow_forwardWrite a C++ program using classes that readslines from a file until the end of file. The program should prompt the user for the file name to read from. The program should open the file for reading, and if the filecannot be opened, print the message “File couldn’t be opened”, followed by a space and the filename, and exit. The program should keep track of the number of lines, the number of non-blank lines, the number of words, and the number of integers read from the file.arrow_forwardWrite program that reads a list of names from a data file and displays the names to the console. The program should prompt the user to enter a filename. Create such a file and check your code. Solve with python. Example of code format: #Prompt the user for file name file_name = input("Enter file name : ") #Open file with open(file_name,"r") as file: #Read file content f = file.readline() #split the contents into numbers numbers = f.split(' ') test_list = [int(i) for i in numbers] res = 1 #Find the product for i in test_list: res*=i #Print result print("Product of numbers in the list :",res)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