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
Concept explainers
Question
Hello, please give me the code to get the output, below. The language is Python. Thanks
The cryptography function crypto () takes as input a string(i.e., the name of a file in the current directory). The function should print the file on the screen with this modification: Every occurrence of string 'secret' in the file should be replaced with string 'xxxxxx'
>>> crypto('crypto.txt')
I will tell you my xxxxxx. But first, I have to explain why it is a xxxxxx.
And that is all I will tell you about my xxxxxx
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 2 steps with 2 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
- In C++ PLEASE Use the text file from Chapter 12, forChap12.txt. SEE BELOW Write a program that opens a specified text file then displays a list of all the unique words found in the file. Addition to the text book specifications, print the total of unique words in the file. Text File = forChap12.txt No one is unaware of the name of that famous English shipowner, Cunard. In 1840 this shrewd industrialist founded a postal service between Liverpool and Halifax, featuring three wooden ships with 400-horsepower paddle wheels and a burden of 1,162 metric tons. Eight years later, the company's assets were increased by four 650-horsepower ships at 1,820 metric tons, and in two more years, by two other vessels of still greater power and tonnage. In 1853 the Cunard Co., whose mail-carrying charter had just been renewed, successively added to its assets the Arabia, the Persia, the China, the Scotia, the Java, and the Russia, all ships of top speed and, after the Great Eastern, the biggest ever…arrow_forward-all-occurrences-of-a-substring-in-a-string/.arrow_forwardWhat does the following python code do? f = open("sample.txt", "w") Choose all that apply. Select 2 correct answer(s) a. writes "w" to the file called sample.txt b. if the file sample.txt exists, deletes everything in it c. closes a file called sample.txt d. If the file called sample.txt exists, it writes at the bottom of the file e. opens a file called sample.txt for appending f. if the file sample.txt does not exist, it creates the file and opens it for writing g. reads the file called sample.txt starting from the top h. opens a file called sample.txt for readingarrow_forward
- pythonarrow_forwardPlease use Python for this question. Please format code properly when answering the question. Write a standalone function partyVolume() that takes accepts one argument, a string containing the name of a file. The objective of the function is to determine the Volume object that is the result of many people at a party turning the Volume up and down. More specifically: the first line of the file is a number that indicates the initial value of a Volume The remaining lines consist of a single character followed by a space followed by a number. The character will be one of ‘U” or ‘D’ which stand for “up” and “down” respectively. The function will create a new Volume object and then process each line of the file by calling the appropriate method of the Volume object which changes the value of the Volume. The function then returns the final Volume object. Guidelines/hints: This is a standalone function, it should NOT be inside (indented within) the class. It should be listed in…arrow_forwardIn Python, Write a program that prompts the user for a file name. (Use problem 2.txt file) Each line of the file should be preceded by a line number followed by a colon in the program. The numbering of lines should begin at number 1. BE SURE THERE ARE NO EXTRA SPACE BETWEEN THE LINES. problem 2.txt file contents: Python language is incredibly easy to use and learn for new beginners and newcomers. The python language is one of the most accessible programming languages available because it has simplified syntax and not complicated, which gives more emphasis on natural language. Due to its ease of learning and usage, python codes can be easily written and executed much faster than other programming languages. Sample output: Answer Enter a file name: Problem 2.txt line 1 Python language is incredibly easy to use and learn line 2 for new beginners and newcomers. The python language line 3 is one of the most accessible programming languages line 4 available because it has…arrow_forward
- Can you help me write the following C++ program: Add a search command to the file viewer created. Thiscommand asks the user for a string and finds the first line that containsthat string. The search starts at the first line that is currently displayedand stops at the end of the file. If the string is found, then the file willbe scrolled down so that when it is redisplayed, the line that contains thestring is the first line at the top of the window.If the string is not found, the program prints the following error messageat the top of the screen:ERROR: string X was not foundwhere X is replaced by the string entered by the user. In that case, theprogram redisplays the lines that the user was viewing before the searchcommand was executed.Modify the program as little as possible. Make sure you assign new responsibilities to the most appropriate components. Use the C++ string operation find. The file viewer code is given below: // FileViewer.cpp #include "FileViewer.h" using namespace…arrow_forwardWrite code that uses the input string stream inSS to read input data from string userInput, and updates variables userMonth, userDate, and userYear. Sample output if the input is "Jan 12 1992": Month: Jan Date: 12 Year: 1992arrow_forwardplease help on this python problem, produce new codarrow_forward
- 9.Code please. In this exercise you will create a program that will be used in a digital library to format and sort journal entries based on the authors last name. Each entry has room to store only the last name of the author. Begin by removing the first name "Isaac" from the string variable journal_entry_1 by using the string function erase. Do not forget to also remove the whitespace so that the string variable journal_entry_1 will then contain the string "Newton" with no whitespaces. The journal entries should be sorted alphabetically based on the authors last name. For example, the last name "Brown" should come before the last name "Davis" Create an if statement so that if the last name contained within journal_entry_2 is alphabetically less than the last name contained within journal_entry_1, then the string values are swapped using the string function swap. You may use either of the comparison operators < > in the if statement but remember that following ASCII, "A" is…arrow_forward9b_act2. Please help me answer this in python programming.arrow_forwardreads in a file of student academic credit data. Each line of the input filewill contain the student name (a single String with no spaces), the number of semester hours earned (an integer),the total quality points earned (a double).Here is the students.dat data file:students.dat Smith 27 83.7Jones 21 28.35Walker 96 182.4Doe 60 150Wood 100 400Street 33 57.4Taylor 83 190Davis 110 198Smart 75 292.5Bird 84 168Summers 52 83.2 My question is how can I create the <<students.dat>> I already have the code but I just need help to create the students.datarrow_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