Write a program that finds all the occurrences of a word in all thefiles under a directory, recursively. Your program should prompt the user to enter a directory name.
Q: 3. Matrix A is said to be symmetric if and only if Ai]=A[]Q for all indices i and j. Write a program…
A: Symmetric matrix is a square matrix which is equal to its transpose.
Q: Write a program that first reads in the name of an input file and then reads the input file using…
A: PROGRAM: #Defining the readFile() function def readFile(file_Name): dictn = {} with…
Q: For a Python program to prepare to put data into an existing file, you would use something like…
A: Python provides various modes for opening and working with files, and the choice of mode determines…
Q: Write a python program that scans in a large number of tweets from a file, and prints the top 5…
A: Open the file of tweets and read its contents into a variable. Use regular expressions to extract…
Q: Write a program that first reads in the name of an input file and then reads the input file using…
A: NOTE - I have done code using the Python programing language. Here I have taken input from the user…
Q: In a file called recursion.java, create: o a recursive function that reverses a string o a recursive…
A: Code
Q: In Python. I am suppose to write a file using this code that takes the info in the names file and…
A: Please provide a correct path for the file that you are reading please check if you are calling each…
Q: consider a program that reads data from a text file called: "klingon-english.txt" (shown below). How…
A: As the programming language is not mentioned here, we are using PYTHONThe code is given below with…
Q: Write a program that replaces all occurrences of a word with anew word in all the files under a…
A: Program: //include the required header files import java.io.*; import java.util.Scanner;…
Q: Create a Java program that uses a stack to return a list containing all permutations of a given…
A: Solution:-- 1)The given question has required for the solution which is to be provided as the Java…
Q: Write a program in C++ that creates a file and writes data into that file column wise. The problem…
A: The Algorithm of the code:- 1. Declare a string variable to store the name of the file to create and…
Q: In this assignment you will write a program that encrypts a text file. You will use the following…
A: C Programming which refers to the machine-independent programming language that it is mainly used to…
Q: Write a program that first reads in the name of an input file and then reads the input file using…
A: Here, Code instruction is given.
Q: Write a program in C/C++ that reads N number of nonnegative decimal numbers from a user and creates…
A: Write a C or C++ program that will give output as per following: Example test run Test Run 1: Enter…
Q: our aim is to determine the largest k numbers among n numbers stored in a text file with one number…
A: Aim: To determine the largest k numbers among n numbers stored in a text file with one number per…
Q: You are writing an inventory system for a library. This program will allow the user to enter a book,…
A: Initialize an empty dictionary called library to store book titles and stock counts.Enter a…
Q: Write a program in MIPS that does the following: Request the name of a file from the user and open…
A: Write a program in MIPS that does the following: Request the name of a file from the user and open…
Q: One common use of a hash table is to build a glossary, or dictionary, of terms. In this section, we…
A: A text file containing a list of words and meanings is initially read into the application to begin…
Q: We want the program to use a DEQueue object to create a sorted list of names. The program gives a…
A: Here's an implementation of the program using a Deque object to create a sorted list of names:
Q: Write a program that declares an array of 5 integers called intArray. Do this in main(). Call…
A: Please find the answer below :
Q: We want the program to use a DEQueue object to create a sorted list of names. The program gives a…
A: Programming Approach : Import the deque class from the collections module. Create an empty deque…
Q: Write a program to output instructions on how to solve an n-disk Towers of Hanoi puzzle. The program…
A: given: program to output instructions on how to solve an n-disk Towers of Hanoi puzzle. The program…
Q: Write a C++ program using Windows API to RemoveDirectory – For Removing the Directory BOOL…
A: C++ program to delete Directory using Window API
Q: write a program with python that asks the user to enter two filenames. One file contains a list of…
A: Note: Follow proper indentation as specified in the code snapshot while implementing code. Random…
Q: Write a program that first reads in the name of an input file and then reads the input file using…
A: I have taken the input from the user. Then, I have opened the corresponding file in reading mode and…
Q: Write a program that first reads in the name of an input fie and then reads the file using the…
A: The asked python program is coded in the next step using for loops and csv.reader method.
Q: Write a complete program that prints out the list of files in the current directory, along with…
A: Source Code: import os import time import sys def files(): #an empty list for storing files…
Q: You have been hired at an open-air mine. You are to write a program to control a digger. For your…
A: Actually, the given information You have been hired at an open-air mine. You are to write a program…
Q: Write a java program for the following: • Create String array with the following values. [ "ee",…
A: Declare the array with the values Then ask for the string that is to be searched. Divide the array…
Q: Twist this assembly code, but this time a program asks the user to write anything and the written…
A: Solution:-- 1)The given question has required for the solution to be provided with the inclusion…
Q: In this assignment, you will write a program that readsa list of people from a file, create a…
A: Code: import java.io.*;import java.util.HashSet;import java.util.Iterator; class Person{…
Q: Write a program called asyncFileCount.js that prints the number of files with a given extension in a…
A: Introduction
Q: The task is to implement part of a linter program using python. Specifically, you must be able t…
A: Introduction: Here is the algorithm for implementing the linter program: 1) Define a function…
Q: x [6146421361333415455411346236116625352552342 43462322433422523224355133513432333444513452…
A: Given : x=[6 1 4 6 4 2 1 3 6 1 3 3 3 4 1 5 4 5 5 4 1 1 3 4 6 2 3 6 1 1 6 6 2 5 3 5 2 5 5 2 3 4 2 4 3…
Q: Exception in thread "main" java.lang.NumberFormatException: For input string: "x" for Java code…
A: The Java code that is provided introduces sumIt and findMax, two recursive procedures that are part…
Q: Write a complete program to do the following: The main program calls a method to read in (from an…
A: the java program is an given below : package normalClasses; import java.io.File; import…
Q: Yellow Tail Migratory Patterns (Note how Happy doesn't give out his address or phone number.) And…
A: Note: - The following program has been tested on below platform: -- g++ 5.4.0 version. -- Linux…
Q: Write a program for the following problem. You're given a file that contains a collection of IDs and…
A: ANSWER:-
Q: a console application for writing data to a sequential text file with a formatter class in Java :
A: 1. create a class to define the file.2. take the location of file from user.3. use catch and throw…
Q: Write a C++ program which reads an int array of size 10 from a “file.txt”. Multiplies 3 from each…
A: #include <fstream>#include <iostream>#include <sstream> using namespace std;int…
Write a program that finds all the occurrences of a word in all the
files under a directory, recursively. Your program should prompt the user to enter a directory name.
Step by step
Solved in 2 steps with 1 images
- Write a program that finds all occurrences of a word in all the filesunder a directory, recursively. Pass the parameters from the command line asfollows:java Exercise18_30 dirName wordWrite a python program that prompts the user for their favorite basketball team. It should be able to read the list of teams provided below in a file called favorite_teams.txt and check if their team is in that file. Teams in the file:JazzBullsMavericksSpursIf the team is in the file let the user know that their team is in the list of favorites. If the team is not in the file, add the team to the end of the file. Also, let the user know that their team will be added to the file.Sample Run in File:What is your favorite NBA team? Jazz [Enter]Your team Jazz is in the listFile before and after run: JazzBullsMavericksSpurs Sample Run not in File:What is your favorite NBA team? Pelicans [Enter]Your team Pelicans is not in the list. It will be added.File before run: JazzBullsMavericksSpursFile after run:JazzBullsMavericksSpursPelicansWrite a C++ program that fills an array of size 100 with random numbers between 1 and 5000, Use srand ( ) with your id as the seed to generate the random numbers. Copy all the odd numbers from an array to a file called Odd.txt . Display number of odd numbers copied to the file.
- Java Your program must read a file called personin.txt. Each line of the file will be a person's name, the time they arrived at the professor's office, and the amount of time they want to meet with the professor. These entries will be sorted by the time the person arrived. Your program must then print out a schedule for the day, printing each person's arrival, and printing when each person goes in to meet with the professor. You need to print the events in order of the time they happen. In other words, your output will be sorted by the arrival times and the times the person goes into the professor's office. In your output you need to print out a schedule. In the schedule, new students go to the end of the line. Whenever the professor is free, the professor will either meet with the first person in line, or meet with the first person in line if nobody is waiting. Assume no two people arrive at the same time. You should solve this problem using a stack and a queue. You can only…In this assignment, you will create a Java program to search recursively for files in a directory.• The program must take two command line parameters. First parameter is the folder to search for. Thesecond parameter is the filename to look for, which may only be a partial name.• If incorrect number of parameters are given, your program should print an error message and show thecorrect format.• Your program must search recursively in the given directory for the files whose name contains the givenfilename. Once a match is found, your program should print the full path of the file, followed by a newline.• You can implement everything in the main class. You need define a recursive method such as:public static search(File sourceFolder, String filename)For each subfolder in sourceFolder, you recursively call the method to search.• A sample run of the program may look like this://The following command line example searches any file with “Assignment” in its name%java FuAssign7.FuAssignment7…Write a java program that will generate a permuterm index from the terms in the files in an input directory. The program should prompt the user for a single directory and find all of the terms (after processing) in each file in it. The program should then find the permutations of each term and store them (keeping track of the original word each permutation comes from). After all of the text files in the directory have been read, the output of the program should display the permutations in sorted order along with the original term. Use the dollar sign as the end of term symbol.
- Write a program that obtains the executiontime of external sorts for integers of size 6,000,000, 12,000,000, 18,000,000,24,000,000, 30,000,000, and 36,000,000. Your program should print a tablelike this:For this assignment, your program will read characters from a string for the purpose of assigning data from that string to the private data members of a class. This simulates a program that would read a record in from a stored file into memory for the purpose of making changes to that record. Below is a template of your program. For this assignment, you MUST use loops (100 pts off if not using loops) and you cannot use the following methods: indexOf() substring() subsequence().One common use of a hash table is to build a glossary, or dictionary, of terms.In this section, we demonstrate one way to use a hash table for just such ause—a computer terms glossary.The program works by first reading in a set of terms and definitions from atext file. This process is coded in the BuildGlossary subroutine. The structureof the text file is: word,definition, with the comma being the delimiter betweena word and the definition. Each word in this glossary is a single word, but theglossary could easily work with phrases instead. That’s why a comma is usedas the delimiter, rather than a space. Also, this structure allows us to use theword as the key, which is the proper way to build this hash table.Another subroutine, DisplayWords, displays the words in a list box so theuser can pick one to get a definition. Since the words are the keys, we can usethe Keys method to return just the words from the hash table. The user canthen see which words have definitions.To retrieve a…
- This is a python file Fix this code and the output is the attachment #filename: modValidateEmail.py def isValidMSUMEmail(email): if email.count('@') != 1: return False tmp= email.split('@') if len(tmp) == 0: return False userName = tmp[0] if not userName[0].isalpha(): return False for c in userName: if not c.isalpha() and c != '.': return False inst= tmp[1] if inst != 'mnstate.edu': return False else: return True #filename: UnitTestValidEmail.py from unittest import * from modValidateEmail import * class TestValidEmail(TestCase): #create a subclass of unittest.TestCase def testUserName(self): self.assertEqual(isValidMSUMEmail('.joe@mnstate.edu'),False) self.assertEqual(isValidMSUMEmail('joe4@mnstate.edu'),False) self.assertEqual(isValidMSUMEmail('joe$smith@mnstate.edu'),False) self.assertEqual(isValidMSUMEmail('joe.smith@mnstate.edu'),True) def…Write a python program that stores current grades in a dictionary, with course codes as keys and percent grades as values. Start with an empty dictionary and then use a while loop to enable input of course codes and percent grades from the keyboard. Enter data for at least five courses. After entering the data, use a for loop and the keys to show the current status of all courses. This same loop should include code that enables determination of the worst course and the average of all courses. Both of these findings should be printed when the loop ends. The worst course should be dropped and reported. This being done, the program should use another loop and the items method to display the revised courses and grades and report the revised term average.in C++ solve the following question in the picture :