Do the following questions: a. Create a function that takes a source file name and destination file name as parameters and copies all the characters from the source file to the destination file except #. b. A list L1 = [10,3,44,52] has the following elements. Write a program that replaces all the number divisible by 3 with 'Yes' and not divisible by 3 by 'No'.
Q: Problem 3. Recollect that the standard implementation of the Dijkstra's algorithm uses a priority qu...
A: // C++ is using to write the dijkstra's algorithm uses a priority queue that supports extract-min() ...
Q: 4. Write definitions for the following two functions: sumN (n) returns the sum of the first n natura...
A: I give the required code in Python along with output and code screenshot
Q: People find it easier to read time in hours, minutes, and seconds rather than just seconds. Write a ...
A: The number of seconds in an hour are 60 * 60 = 3600, the number of seconds in a minute are 60. These...
Q: 11. Write code that reproduces the output shown below. 1]: # Code Here 2]: # DON'T WRITE HERE 2]: ar...
A: Explanation: This is the array that transforms sequences of sequences into two-dimensional arrays. S...
Q: 2. 2 independent problems about Elgamal: (a) what things go badly if Alice picks the private keys 0 ...
A: Plain text in cryptography: Packet headers are generally plain visible text before it will be secure...
Q: 2. Write a program to create a lambda function that adds a given number to another given number pass...
A: As the porgramming language is not added solving the question in python . What is lambda function :...
Q: What function does system modeling play in the software development process
A: What function does system modeling play in the software development process?
Q: 1. Discuss the Cozy Bear incident of hacktivism. 2. please provide the references website 3.in-tex...
A: INTRODUCTION: Cozy Bear is a Russian hacker organization thought to be linked to one or more Russia...
Q: Develop a program that 1- Would read an input from the keyboard. The input should be a whole positiv...
A: while True: #1- Would read an input from the keyboard. The input should be a whole positive numbe...
Q: Computer science What is the best way to install S3FS on Ubuntu?k
A: Introduction: Ubuntu is equipped with everything you'll need to run your corporation, school, home, ...
Q: Convert the following NFA to an equivalent DFA
A:
Q: Write an assembly program to set R0=1 if there's a 5 in one of ten memory locations, starting at x31...
A: Let me give it's full discription: 1. First we set R0=1, R1=-5 ,r3=10, R4=x3100 , R2=M[R4] then we c...
Q: Using a the shopping situation, explain briefly what is all about computer security, highlighting o...
A: A) Using a the shopping situation, explain briefly what is all about computer security, highlighting...
Q: Here are the recurrence relations: TA(n) = 2 x TA ( +n Тв (п) %3D 4 x Тв +n? Tc(n) = 8 x Tc + n Tp(n...
A: In this problem time complexities are to be arranged from deepest to the shallowes. Depth is logb(n)...
Q: : How to link a Spring Boot application to an AWS S3 web service
A: Introduction: Create a new Spring Boot application with h2, spring boot dev tools, spring data jpa, ...
Q: Suppose that you are hired by a police department to write a program that matches arrest records wit...
A: the answer is an given below :
Q: Exercise 1: 6AWT Counter Counter Count Up Count Down Reset
A: JAVA Code: import java.awt.*;import java.awt.event.*;import javax.swing.*; public class Counter exte...
Q: b) Define multidimensional array with example. Write a C program segment for storing 60 student mark...
A: answer is
Q: Software Functionality: Download a Great Plains software demo programme and analyse its accounts rec...
A: Intro The intense completion and fluctuating sales forced the vendors of enterprise resource plannin...
Q: A foreign key must not be null under what circumstances?]
A: In other words, a foreign key is utilized to uniquely identify a row in another table.
Q: What is the difference between logical data flow diagrams and physical data flow diagrams?
A: What is the difference between logical data flow diagrams and physical data flow diagrams?
Q: Topic: Concepts of programming Language Kindly provide a bit detailed answer 4. a) Consider the fo...
A: Dynamic Scoping : Dynamic scope refers to scope of a variable is defined at run time rather than at ...
Q: Using JAVASCRIPT, print the count of all the vowels present in the string "Data Structures and Algor...
A: Write a JAVASCRIPT program to print the count of all the vowels present in the string “Data Structur...
Q: Create a stack-based application to convert infinix to postfix.
A: Introduction: An expression can be written in Infix, Postfix, and Prefix Notation. In Infix Notation...
Q: Android Studio project Using Java language to Design a game to find the difference between images in...
A: CompareTwoImages.java import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.Buf...
Q: def is_valid_index(idx, in_list): """ Checks whether the provided index `idx` is a valid...
A: if (idx in in_list - 1): if len(idx) != 0: return idx else: re...
Q: Discuss how data quality audits can help verify the accuracy of information obtained from the Inform...
A: huge volume of data is available in companies, maintanance of the these data is difficult. these dat...
Q: For the Boolean functions F(X,Y,Z) and E(X,Y,Z), as given in the following truth table: (a) List the...
A: Given: Given the Boolean functions F(X,Y,Z) and E(X,Y,Z), as given in the following truth table we...
Q: How do you keep an office with shared resources like a printer secure?
A: Introduction: Shared resources are equipment that may be accessed by several remote computers that a...
Q: ii) Write a JAVA program to prompt the user to enter a secret message in the form of a string. If th...
A: Code: import java.util.Scanner; class Main{ public static void main(String args[]){ Scanner m...
Q: Program to input the elements(integer type) of a array of size 17 and check if all the elements of t...
A: Return true before checking all the elements of the array. Counter to count the number of odds or e...
Q: 3. Write a Python script to save the dictionary words in the 'wordlist.txt' file, and then compress ...
A: Algorithm: Start Store "wordlist.txt" in wordlist Store "protected.zip" in zipFile Initialize the Z...
Q: If a process forks two processes and these each fork two processes, how many processes are in this p...
A: When a process forks, the operating system makes a copy of that process. The only difference is that...
Q: c routing protocols. What are the primary differences between the two and when would you use one ove...
A: given - OSPF and BGP are two of the most common dynamic routing protocols. What are the primary diff...
Q: Q. Write a program to find particular element in tuple. Tuple: (11,33,44,55,66) Enter the element to...
A: As per the requirement program is written in python. Algorithm: Step 1: Initialize the tuple with na...
Q: In SQL, explain the most important data integrity restrictions.
A: Introduction: The general correctness, completeness, and consistency of data are data integrity. Ad...
Q: Data Structures and Algorithm In Breadth First Search(BFS): How do you keep track of nodes in you...
A: Given: We need to explain about (BFS) Breadth First Search Algorithm and how do we keep track of no...
Q: Consider the following AVL tree. 70 80 50 90 After inserting 60, what is the height and balance fact...
A: AVL TREE:An AVL standards for Adelson,Velskii,Landis.The AVL is is one of the binary search tree(bst...
Q: What are the notions of functions in Swift again? What are some of Swift's functionalities that dist...
A: Intro A function is a block of statements that performs a particular task. It is given a name that d...
Q: need help making a calendar that shows what day they need to show a demo of their product
A: Create a Lightning Web Component and use below code
Q: Create a flowchart that determines whether the positive number typed by the user is a prime number o...
A: Here in this question we have asked to create a flow chart that check for given number is prime numb...
Q: Count the number of occurrences of substrings "baba" or "mama" * in the input string recursively. T...
A: PROGRAM CODE: class Main{ public static boolean isEmpty(String s) { return s == null || s.length()...
Q: What is the process of implementing multifactor authentication? What role does it play in the preven...
A: Introduction: A physical token or card is a second element in the multi-factor authentication proces...
Q: Consider the transaction database represented by the matrix
A: Introduction:- Union(U):-Let where 'S' is the set of sets and A,B,C are sets. AU(BUC)=AUBUC=...
Q: What are the THREE advantages that the Microsoft Excel system has brought you in your firm, in your ...
A: here we have given three advantages that the Microsoft excel system has bought
Q: Some viruses are hidden in macros, which are instructions saved in software such as a word processi...
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other questions ...
Q: What exactly is memory hierarchy? Describe using proper graphic representation.
A: Intro What exactly is memory hierarchy? Describe using proper graphic representation.
Q: Explain the output of this program
A: In the given program, the Scanner class is initialized to read user input. Using Scanner's object, t...
Q: Objective Define a circular buffer data structure and test it. Problem Description: A circular b...
A: I have answer this question in step 2.
Q: 2.16 LAB: Convert to seconds Write a program that reads in hours, minutes and seconds as input, and ...
A: For completing this program, we will follow the subsequent steps: Initializing the Scanner class As...
Step by step
Solved in 2 steps with 2 images
- The following Python code is a partially written function that attempts to read a file's contents into a dictionary. Fill in the missing code in the make_dictionary function. You do not need to copy any of the existing code. Just write the code that would go in place of "YOUR CODE HERE". def make_dictionary(filename):'''Function -- make_dictionaryCreates a dictionary from a file's contents. Each line in the file is split into a list at commas.If, after splitting, the list contains exactly 2 parts,the first item is added to the dictionary as a keyand the second item is the value. If the providedfile doesn't exist, the message "File doesn'texist" is printed to the terminal and anempty dictionary is returned.Parameter:filename -- The name of the file to open.Returns:A dictionary of the file's contents, if thefile matches the expected format. Otherwise, anempty dictionary is returned.'''contents = {}# YOUR CODE HEREreturn contents Example If the contents of the file passed to the function…Complete the below function that takes a file name and a list as arguments and reads the text within the corresponding file, then creates a dictionary whose keys are the characters of the provided list, and the values are the counts of these characters within the text. If a character in the list is not included in the text, "0" should be written in the dictionary as the value of this character. The function returns the created dictionary as a result. If the file does not exist, then the function returns an empty dictionary. def text2dict(filename, characters): in python2. Write a function addname( ) that takes two strings, a filename, memberList.txt, and person’s name as parameters and adds the new name to the end of the list. The function will write the new file as memberList.txt. If the name is already in the list, the name will not be added.
- 1. Given two .txt files that have lists of numbers in them, find the numbers that areoverlapping (print them in the output). “primenumbers.txt” has a list of all primenumbers under 1000, and the other “happynumbers.txt” has a list of happy numbersup to 1000.We can divide this problem into different parts:a. Write a function (call it readFile) that takes the name of a file as argument and read the content of the file and store it in a list (each line contains onenumber, so each number is stored in the list) and return the list.b. Write a function that takes two lists and return another list containing thecommon elements of two lists (you have written this function before! You canuse it)c. Write a function (call it writeFile) that takes a list and name of a file. The function should write the content of the list in the file (each element in oneline).d. Use the above functions to do the task of this lab.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') FalseComplete the below function that takes a file name and a list as arguments andreads the text within the corresponding file, then creates a dictionary whosekeys are the characters of the provided list, and the values are the counts ofthese characters within the text. If a character in the list is not included in the text, "0" should be written in the dictionary as the value of this character. The function returns the created dictionary as a result. If the file does not exist, then the function returns an empty dictionary. Here is an example case, assuming a file named "sample.txt" exists with the following content: ----- sample.txt -----This is an example sentence.This is yet another sentence.------------------------- >>> text2dict("sample.txt", ['a', 'b', 'c', 't']){'a':3, 'b':0, 'c':2, 't':4} """ def text2dict(filename, characters):return # Remove this line to answer this question
- Complete the below function that takes a file name and a list as arguments andreads the text within the corresponding file, then creates a dictionary whosekeys are the characters of the provided list, and the values are the counts ofthese characters within the text. If a character in the list is not included in the text, "0" should be written in the dictionary as the value of this character. The function returns the created dictionary as a result. If the file does not exist, then the function returns an empty dictionary. Here is an example case, assuming a file named "sample.txt" exists with the following content: ----- sample.txt -----This is an example sentence.This is yet another sentence.------------------------- >>> text2dict("sample.txt", ['a', 'b', 'c', 't']){'a':3, 'b':0, 'c':2, 't':4} (DONT USE İNPUT .VERY İMPORTANT.)Computer Science I need a C++ program that will take a list of random integers from a .txt file, scan them, and find + print the amount of prime numbers. I've seen this question posted here before but none of the responses have yielded the correct answer. The exact question is as follows: "Download the "Big List of Random Integers" file. Then write a program that makes use of the isPrime function you've already written that scans a file of integers and determines the number of primes found within. "#Problem #1 Searching for a Item in a File Write a program named SearchFile.py that reads in a list of items from a text file and looks for the presence of one that the user enters from the keyboard. During the search, have a loop that ends when they type in DONE for the word. For ours, we will search for a bird name but the idea would be applicable for any searching in a file.
- 12.12 LAB: File name change A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is:12.12 LAB: File name change A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is: ParkPhotos.txt and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg AmericanSamoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns2010_photo.jpg CraterLake1996_photo.jpg GrandCanyon1996_photo.jpg IndianaDunes1987_photo.jpg LakeClark2009_photo.jpg…9.12 LAB: File name change PYTHON A photographer is organizing a photo collection about the national parks in the US and would like to annotate the information about each of the photos into a separate set of files. Write a program that reads the name of a text file containing a list of photo file names. The program then reads the photo file names from the text file, replaces the "_photo.jpg" portion of the file names with "_info.txt", and outputs the modified file names. Assume the unchanged portion of the photo file names contains only letters and numbers, and the text file stores one photo file name per line. If the text file is empty, the program produces no output. Ex: If the input of the program is: ParkPhotos.txt and the contents of ParkPhotos.txt are: Acadia2003_photo.jpg AmericanSamoa1989_photo.jpg BlackCanyonoftheGunnison1983_photo.jpg CarlsbadCaverns2010_photo.jpg CraterLake1996_photo.jpg GrandCanyon1996_photo.jpg IndianaDunes1987_photo.jpg LakeClark2009_photo.jpg…