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
Instructions for a computer Python file I have to create called "Markov.py"
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
- Write a program that replaces all occurrences of a word with anew word in all the files under a directory, recursively. Pass the parameters fromthe command line as follows:java Exercise18_31 dirName oldWord newWordarrow_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 to read several lines from a file. For each line, check (recursively) whether it is a palindrome. If it is a palindrome output the original string preceded by an integer (a counter) , like this: 1 : Sore was I, ere I saw Eros.2 : A man, a plan, a canal -- Panama Recall that a palindrome is a String that is the same backwards and forwards. Some examples of single words that are palindromes are: level, madam, racecar Phrases can also be palindromes if you strip out all the whitespace and punctuation and make everything the same case. Some examples are: Madam, I'm Adam A Toyota's a Toyota (See the palindrome video for more) You will need one method to eliminate whitespace and punctuation , make everything lowercase, and return the new string. Use the recursive method you wrote in L15Num2. This returns a string with no whitespace or punctuation, but not all the same case. Then (in main) convert that string to lowercase. You need a recursive method that takes the new…arrow_forward
- Implement a blog server in C 1. Implement get of all posts (GET /posts), and individual post (GET /post/1) 2. Implement creation of post (POST /posts). Allow the user to enter their name, but check that they are a valid user in db. Do error checking! The user should not specify the post id; that should come from the database. 3. Write three html files to test this; serve them with the blog server: index.html shows the list of posts with a link to each. post.html shows a post. publish.html allows the creation of a new post. Link these together as a user would expect!arrow_forwardWrite a program to process stock data. The stock data should be read from a text file containing the following data: stock code, stock name, amount invested (XXX.XX), shares held, and current price. Sue the internet or your local paper to gather data on at least 20 stocks. As each stock is read, insert it into a doubly linked list. The first logical list should be ordered on the stock code. The second should be ordered on the gain or loss for the stock. Gain or loss is calculated as the current value of the stock (shares held times current price) minus the amount invested. Include at least one loss in your test data. After building the lists, display a menu that allows the user to display either logical list forward or backward (a total of four options). Each display should contain an appropriate heading and column caption. Run your program and submit a list of your input data and a print out of each display option.arrow_forwardThe latest version of Python is 3.7.4.Four file objects, one for each of the following: winter, spring, summer, and fall2003.txt, should be stored in the variables winter, spring, summer, and autumn (respectively). They should all be opened for reading at the same time to facilitate comparison.arrow_forward
- Write a program that receives a coded message file(Lab3ExtraCreditCT.txt) from your local espionage agent and decodes it into a file using standard English. The problem is your agent forgot to tell you the key used to decode the message. Fortunately, this is a simple substitution code consistently using 1 alphanumeric character to represent another, this is case sensitive. All other characters are not substituted, so a space will always be a space, a – will always be a –, a @ will always be a @, etcetera. You may use the following table to help you, it contains the most common letters used in the English language in descending order. E A R I O T N S L C U D P M H G B F Y W K V X Z J Q 0 5 3 2 4 6 8 1 9 7 Using the following key to convert plaintext to coded text: Plaintext = Now is the time for all good men to come to the aid of their country. Key = THEQUICKBROWNFXJMPSVLAZYDG The file your program outputs should look like this: Coded Text = Fxz bs vku vbnu ixp tww…arrow_forwardpython please. write code so it can be copied. Find a text file online that contains the English dictionary. Write a program that cycles through this text file to find compound words. Your program should return these compound words along with the two words that compose it. For example, a “raincoat” is a compound word so your program should return raincoat = rain + coat.arrow_forwardNarrative 2: We need to have a generic module which reads in file and gives the output in the format which would facilitate other programs to do comparison like the one we saw above to carry out analysis and comparison. Response Required: Write a program that reads a given text, outputs the text as is, and also prints the number of lines and the number of times each letter appears in the text. An uppercase letter and a lowercase letter are treated as being the same; that is, they are tallied together. Since there are 26 letters, we use an array of 26 components to perform the letter count. We also need a variable to store the line count. The text is stored in a file, which we will call textin.txt. The output will be stored in a file, which we will call textout.txt Input: A file containing the text to be processed. Output: A file containing the text, number of lines, and the number of times a letter appears in the text. Note: Compile the code on any software and take the secreenshots…arrow_forward
- Consider an empty stack of integers and a text file with the following numbers: 1,2,3,4,5,6. You can only read the numbers from left to right, and you can only read once (which means you can only push a number once). Let S indicates a push and X indicates a pop operation. The pop operation also prints the value of the element just popped. Please write the sequence of S and X operations to print the numbers in the following orders: 325641.arrow_forwardMake use of a random number generator to generate a list of 500 three-digit numbers. Create a sequential list FILE of the 500 numbers. Artificially implement storage blocks on the sequential list with every block containing a maximum of 10 numbers only. Open an index INDX over the sequential list FILE which records the highest key in each storage block and the address of the storage block. Implement Indexed Sequential search to look for keys K in FILE. Compare the number of comparisons made by the search with that of the sequential search for the same set of keys.Extend the implementation to include an index over the index INDX.arrow_forwardWrite the full LabProgram.javaarrow_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