please code in python count_word: This function takes a filename and a keyword. Return the number of times the keyword occurs in the file. Initialize a variable to keep track of the number of times the keyword appears. Traverse the file by line. Use the count method on each line to find the number of times the keyword appears in it and add that amount to the variable
Q: Does this mean that software developers have a moral or ethical obligation to create code that can…
A: Software engineers design, create, and enhance the programs that support our contemporary way of…
Q: Start a discussion about how mobile devices, such as tablets and smartphones, may be used in the…
A: For many years, there has been debate concerning the use of mobile devices at work. While some…
Q: 9. In cell C14, create a formula using the COUNTA function to count the number of components in the…
A: MS Excel is a powerful spreadsheet software program developed by Microsoft for Windows, macOS,…
Q: Do databases need ethical considerations? Employee income and benefits data may not belong in the…
A: Databases ought to think about morality. Sensitive personal information is stored in databases to…
Q: Discuss briefly why it is inappropriate to use the Process (Non-Formal) method of software…
A: A set of steps are involved in the software development life cycle when developing and updating…
Q: What do you consider to be the key distinction between business intelligence and analytics?
A: Business intelligence and analytics are an umbrella that describes the applications, infrastructure,…
Q: How extensively can I utilize the IT simulation viewer?
A: Depending on your particular requirements and goals, you can leverage an IT simulation viewer to…
Q: These are some key distinctions between SLA and HDD
A: Data is stored in NAND-based flash memory by solid-state drives (SLAs), a type of storage device. It…
Q: 1)Create two Java classes, Desktop and Laptop that both are subclasses of Computer. a) A Desktop has…
A: Computer.java package acesssm1; public class TestComputer { public static void main(String[] args)…
Q: Is there going to be a significant need for the development of older systems down the road? At what…
A: There will be a significant need for the development of older systems in the future depends on the…
Q: Give concrete examples to distinguish between digital piracy and intellectual property infringement.
A: Digital piracy and intellectual property infringement are two terms that are commonly used…
Q: What is microprocessor explain in details
A: A microprocessor is an electrical component that functions as a computer's or other digital device's…
Q: Question 6 Not complete Marked out of 6.00 P Flag question a) What is the postfix notation for the…
A: Note: This is a multipart based question. As per company guidelines only first three parts are…
Q: The programmable connections in PLDs are implemented using a variety of process technologies;…
A: Below are six examples of process technologies that may use PLD programmable connections for your…
Q: How can we improve a program's capacity to adapt to new circumstances throughout its development?…
A: Improving a program's capacity to adapt to new circumstances throughout its development can be…
Q: In what ways may an organization lessen the possibility that its workers will violate the law?…
A: Organizations can take several proactive measures to reduce the likelihood of their workers…
Q: Name three technological processes that have been digitized in their entirety. Were there distinct…
A: Let's first discuss about what exactly is digitized technological processes then we will see three…
Q: Write a program to compute the exact value of the number of array accesses used by top-down…
A: To calculate the precise value of the number of array visits used by top-down and bottom-up…
Q: How susceptible is your computer to the many kinds of security holes that exist today? How can we…
A: In today's digital age, computers are vulnerable to various security vulnerabilities that can…
Q: Why would you need a router?
A: A router is a piece of networking gear that facilitates interaction between networks. This reply…
Q: Does this mean that software developers have a moral or ethical obligation to create code that can…
A: Software developers play a critical role in creating and maintaining code that is reliable,…
Q: Legacy system development options? When is system replacement cheaper than software update?
A: An outdated computer system, software program, or piece of equipment still used by a company or…
Q: As the CIA's "holy trinity" of secrecy, trust, and vigilance appears to be in action only seldom,…
A: The "holy trinity" of CIA's secrecy,The Central Intelligence Agency (CIA) leads the United States…
Q: Answer the given question with a proper explanation and step-by-step solution. This is the…
A: The program by including the necessary header files and defining the Date class The Date class has…
Q: When should data replication be used in a distributed database system to prevent data fragmentation?…
A: Data fragmentation is a common issue in distributed database systems, where data is spread across…
Q: A condition variable is an object able to the calling thread until notified to resume. block…
A: Condition variables are synchronization primitives that enable threads to wait until a particular…
Q: Describe a time when you found it difficult to communicate in an online course or programme. Do you…
A: In recent years, online learning has become increasingly popular due to its flexibility and…
Q: How different are the most common error signals from one another, and what do they typically mean?
A: The explanation and response to the question are given here.Respond Depending on the context in…
Q: Identify three insecure or at Kable protocols as most users depend on the network.
A: As more and more people rely on computer networks for communication and data exchange, the security…
Q: 3. (Score 30%) Implement pseudocode num TermSeries given in the solutions to homework #05 for…
A: Below is the Python code for implementing the numTermSeries pseudocode:
Q: What features should you look for in a new laptop the most?
A: When shopping for a new laptop, finding the one that meets your needs is crucial. The variety of…
Q: If there are three occurences of four different values within the data and nopvalue twice, how many…
A: Distribution is defined as the spreading of the product via the marketplace such that a large number…
Q: How should we address the many ethical concerns that have developed as a result of the broad…
A:
Q: A machine cycle consists of these four parts, and is also sometimes called a process loop. What…
A: Modern life includes machines. From production to transportation, we use machines. Input,…
Q: Identify three insecure or attackable protocols as most users depend on the network.
A: Identify three insecure or attackable protocols as most users depend on the network answer in below…
Q: write a custom Snort rule to handle Inbound and Outbound HTTP traffic on the Private (Host-Only)…
A: HTTP network traffic refers to the data transmitted over the HTTP protocol between a client (such as…
Q: So why does it matter so much that your bio is always fresh?
A: In this question we have to understand why doses it matter so much that bio is always fresh ? Let's…
Q: Should we promote the importance of cloud storage without minimizing the need for data backup for…
A: Cloud storage and data backup are both crucial components of modern business operations. Cloud…
Q: In what ways may an organization lessen the possibility that its workers will violate the law?…
A: Preventing workers from violating the law is essential for any organization to maintain a good…
Q: Why is it so difficult to avoid change in complex systems? What types of things happen over the…
A: Hello student Greetings Hope you are doing great. Thank you!!!
Q: Operating systems are used for providing virtual computers, enabling several activities at once, and…
A: It promotes the interchange of data between software and the physical components of the computer.…
Q: What is an optimizing compiler and how does it function? When would you want to use one as a…
A: An optimising compiler is a type of compiler that converts source code into optimised machine code…
Q: Two techniques for reducing rework expenses should be provided. Consider the need of progressive…
A: Certainly, here are two techniques for reducing rework expenses that incorporate progressive…
Q: Memory on Siobhan's computer is 8 gigabytes. The 8GB used by her programmes is in addition to the…
A: To understand how Siobhan's computer can utilize 8GB of memory for programs in addition to 2GB used…
Q: Answer the given question with a proper explanation and step-by-step solution. Below is your…
A: In the given code snippet, a function named "add" is defined that adds all items in the tuple and…
Q: Can data be estimated in the big picture? Can a student explore the world without becoming broke?
A: Data is a vital commodity today, and many industries and enterprises depend on it to fuel…
Q: What features should you look for in a new laptop the most?
A: Investing in a new laptop may be costly, so it's crucial to carefully consider which features and…
Q: ying to test the Firebase app on iOS, what kinds of challenges have you run in
A: Firebase is a popular mobile and web application development platform that provides a range of tools…
Q: Regarding computer networks, how important are humans?
A: In this question we have to understand Regarding computer networks, how important are humans ? Let's…
Q: Existed a significant distinction between compiled and interpreted languages?
A: We will understand the differences between compiled and interpreted languages, distinguishing…
please code in python
count_word: This function takes a filename and a keyword. Return the number of times the keyword
occurs in the file. Initialize a variable to keep track of the number of times the keyword appears.
Traverse the file by line. Use the count method on each line to find the number of times the keyword
appears in it and add that amount to the variable
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
- In Chapter 11, you created the most recent version of the MarshallsRevenue program, which prompts the user for customer data for scheduled mural painting. Now, save all the entered data to a file that is closed when data entry is complete and then reopened and read in, allowing the user to view lists of customer orders for mural types.Using Java, Write an interactive console application for an employee management service. The user can enter the following options for the apps 1-List all employees, sorted by Name. 2-Hire a new employee (add to list) 3-show the lowest salary and highest salary and average of the salaries 0-exit - At the beginning of the application, data will be read from a text file. - And at the end of it when user chooses 0, data will be saved to the same file. - The date format needs to be YYYY-MM-DD and The fields needs to be separated by semicolon(;) Example of data in the text file : Alice P.;2012-09-22;Shoes;40 Emma W.;2016-07-07;Furniture;30 Eva;2021-08-08;Pizza;50 EmployeeSchedule class has the following attributes private String name; private String department; private Date dateHired; private double hourSalary; name : between 2-50 characters and not permitted to have ;^?@!~* department : between 2-50 characters and not permitted to have ;^?@!~* dateHired : between 1900 and 2100 salary :…C++ Add a search command that asks the user for a string and finds the first line that contains that string. The search starts at the first line currently displayed and stops at the end of the file. If the string is found, the line that contains it is displayed at the top. In case the user enters a string X that does not occur in the file, the program should print the error message: ERROR: string "X" was not found.
- Implement 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') FalsePlease modify the following code using getline(cin,strObj) with cout<<strObj<<endl; or getline(infile,strObj) with outfile<<strObj<<endl; #include <iostream>#include <fstream>#include <cstdlib> #include <string> int main(){string fileOne = "info.txt"; // put the filename up frontstring fileTwo = "info.bak";char ch;ifstream inFile;ofstream outfile;try //this block tries to open the input file{// open a basic input streaminFile.open(fileOne.c_str());if (inFile.fail()) throw fileOne;} // end of outer try blockcatch (string in) // catch for outer try block{cout << "The input file " << in<< " was not successfully opened." << endl<< " No backup was made." << endl;exit(1);}try // this block tries to open the output file and{ // perform all file processingoutfile.open(fileTwo.c_str());if (outfile.fail())throw fileTwo;while ((ch = inFile.get())!= EOF)outfile.put(ch);inFile.close();outfile.close();}catch…C++ Add a search command that asks the user for a string and finds the first line that contains that string. The search starts at the first line currently displayed and stops at the end of the file. If the string is found, the line that contains it is displayed at the top. In case the user enters a string X that does not occur in the file, the program should print the error message: ERROR: string "X" was not found. Attached is the first lines of the .txt file
- How to code this assignment JSON objects. Hint: Work on the methods in the order they are found in the documentation below. def read_last_line(file_path: str)->str: """ Reads the last line of the file at the specified file path. The function returns the last line of the file as a string, if the file is empty it will return an empty string (""). :param file_path: A path to a file :return: The last line of the file """ def read(file_path: str)->str: """ Reads the entire file at the specified file path. The function returns all the text in the file as a string, if the file is empty it will return an empty string (""). :param file_path: A path to a file :return: All the text in the file """ def write(file_path:str, text:str=''): """ Clears the file at the specified file path then writes the specified line to the file. If the function is invoked without a line parameter or the line variable is None nothing is written to…Here is the code I've tried. Although I used the full path to the file and the file is located in the same directory as my program executable, when I run it is doesn't read the text file #include <iostream>#include <fstream>#include <sstream>#include <iomanip> using namespace std; void loadArrays(string product[], int quantity[], float cost[], int& counter) {ifstream file; //ifstream functionstring inLine, prod, qty, cst; //variables to hold read line temporarily //open input filefile.open("C:\\Users\\Honeypie\\source\\repos\\Project4\\inventory.txt", ios::in); while (getline(file, inLine)) { //read first lineistringstream ss(inLine); //split the line using a delimeter//you may change this delimeter according to your input filegetline(ss, prod, '|');getline(ss, qty, '|');getline(ss, cst, '|'); if (prod != "Product Code") { //if statement that will ignore the column headersproduct[counter] = prod; //insert product code to product arrayquantity[counter] =…Python create function writeAFile() to meet the conditions below- accept two parameters: a string (name of a file) a list- add a meaningful docstring- open the filename for writing- write to the file all of the items in the list.- Each item should be on a separate line in the file.- Count the number of lines written to the file.--- don't forget to close the file- return the number of written linesRestriction: you may NOT use the built-in function len()- params: string list- return: integer
- in python. Write a function named file_sum that takes as a parameter the name of a text file that contains a list of numbers, one to a line, like this: 23.77 116 94 -12.8 0 14.999 The function should sum the values in the file and write the sum (just that number) to a text file named sum.txt.W rite a function named sum_ints that takes no parameters and returns an integer. The function will read a file named "low.txt". Each line of this file will be a properly written whole number. Your function should return the sum of all of those numbers. f = open("low.txt") (PYTHON) No hand written and fast answer with explanationPlease fill in the ellipsis(...) of how to read and write the levels(values) from a file for a price_checker: #Method : Load levelsList using the data in levelsFiledef readLevelsFromFile(self):try:# Set levelsList to an empty listself.levelsList = []# Open the file...# Use a loop to read through the file line by line...# If the last two characters in the line is "\n", remove them......# Append the line to levelsList...# Close the file...except:return #Method: Write levelsList to levelsFile (override the existing file)def writeLevelsToFile(self):# Open the file in a way that will override the existing file (if it already exists)...# Use a loop to iterate over levelsList item by item...# Convert everything in the item to and then add \n to it - before writing to the file... # Close the file... # *************************************************************************************************# Main Code Section#…