Write a function named frameStr that takes as input a string s, and PRINTS on the screen a framed version of s. For example, calling frameStr("Burkay Genç") prints: | Burkay Genç | Similarly, framestr("123") prints: | 123 | +-----+ and, frameStr("") prints: +--- You will write your function in a file called assignment2.py and submit it on codepost.
Q: Please Solve In 20mins In what type of situation kernel density plot is not useful? examples
A: Answer: I have given answered in the handwritten format in brief explanation.
Q: Write a C# Sharp program to print the result of the specified operations Test data: -2 + 4...
A: In this question, we are asked to write a program in C# to print the given expressions result Given:...
Q: What is the result of the beta reduction of : λχ. (y.y y) wz
A: Lambda calculus The λ-calculus(Lambda calculus) is introduced by showing how to construct a real ...
Q: I need the code in 32 bits Assembly language please: Assign the symbol SetupESI to the following li...
A: Before giving answer let's see about Assembly Language. Assembly language and what is 32 bit codding...
Q: Consider a two-class case with classes fraudulent and nonfraudulent. A data mining routine has been ...
A: Given: 50 records as fraudulent (30 correctly so) and 950 as nonfraudulent (920 correctly so)
Q: The first 3D printer was invented by who, and it was in the year 2000.
A: Introduction: Three-dimensional things, such as machine components, may be printed using 3D printers...
Q: 2. In Python programming language, write a program to input a string and then add the string "progra...
A: In Python programming language, write a program to input a string and then add the string "programmi...
Q: DECLARE v_emp_id vr emp employees.employee_idXTYPE : :Enter Employee Id; employeesXROWTYPE; BEGIN SE...
A: Below i have answered:
Q: For graph given in figure I and heuristic table in table 1, answer following questions: Find path fr...
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any ...
Q: Compare mathematical programming versus discrete event simulation approaches to the critical path ho...
A: Question1. Compare mathematical programming versus discrete event simulation approaches to the criti...
Q: . x,y are non-negative integers with x O y = 0. Disprove (with a counterexample) or prove (by induct...
A: Truth table for x xor y:x xor y0 0 = 00 1 = 11 0 = 11 1 = 0 Consider x = y, then if x = 1, y = 1, ...
Q: Explain five (5) major issues that usually complicates effective evaluation of information systems
A: ISSUES OF EFFECTIVE EVALUATION OF INFORMATION SYSTEMS: Humanistic variables -> The absence of da...
Q: What is multiprocessing and how does it work?
A: Multiprocessing in computing, is a method of operation in which two or more processors on a co...
Q: Which is the importance of the identification field in the IP Packets
A: Introduction: Which is the importance of the identification field in the IP Packets The IP header is...
Q: Q4/ A- Find the complement of F=WX +YZ, then show that F.F=o and F+F=1 B- Obtain the 1s and 2s compl...
A: De Morgan's Theorem (A+B)'=A'.B' (AB)'=A'+B' has been used to solve the first part of the question
Q: Computer Science I need a C++ program that will take a list of random integers from a .txt file, sc...
A: The solution to the given problem is below.
Q: What does the term computer mouse mean in plural?
A: Your pointer travels on the screen as you move the mouse, which is a computer name for a corded or w...
Q: Consider a variation of sequential search that scans a list to return the number of **occurrences** ...
A: Second image question is solved below: Sequential search: Best Case: When the searched element is th...
Q: What is the big-O notation for the worst-case runtime of the code fragment below? for (i = 0; i < N;...
A:
Q: According to Andy Growe, "Spending more time on planning should pay off in execution" what does this...
A: I agree with the belief of Alpha managers that spending more time on planning should pay off...
Q: Suppose you were implementing a Company---Employee relationship. Which of these classes would be con...
A: Company comprises (made up of) Employees and hence it is the aggregating class. The existence of the...
Q: 10.2.2.3 Identification Identification-based loT protocols are an interface to identify the tag/devi...
A: The question is identification-based IoT protocols are an interface to identify the /device using a ...
Q: how would you rewrite this to fix overflow? besides changing the array size of the buffer
A: The answer is given below:-
Q: Write a C++ program to find the sum of first and last digit of a user entered number.
A: In this question, we are asked to print the sum of last and first digit of a number entered by user ...
Q: Create a table as the following: 1. three columns (company, contact, country) 2.7 rows 3. the compan...
A: 1.) table tag : The table tag in HTML is used to create a table in a HTML Webpage. 2.) th tag : The ...
Q: Add 9 and 4 Carry bits 4-bit number 4-bit number Result number
A: Solution: Addition of two binary number Given, 9 and 4
Q: can you write a shell script for searching a world inside of a text file?
A: Algorithm: Start Read word to search If grep -q $word hello.txt, then print word found else print n...
Q: Computer Science Given these two relational schemas and sets of functional dependencies: 1) R(V,W,X...
A: Answer: I have given answered in the handwritten format in brief explanation
Q: Implement golden ratio approach in java to help find the best time
A: Here is an example of how to use golden ration in Java: Find nth Fibonacci number using Golden r...
Q: Create a C++ program for the following: Using Herod’s Formula, calculate the area of a triangle wit...
A: Here is your solution with an output. Result is used to measure the sides of the triangle is cm. sid...
Q: hat is the time complexity (in big-O notation) of binary search in a sorted array containing m (m >0...
A: Ans: the time complexity (in big-O notation) of binary search in a sorted array containing m (m >...
Q: What does this do in shell? #!/bin/bash for i in “$@“; do if [-d “$i”]; then chmod 755 “$i” f...
A: "$@" Stores all the arguments that were entered on the command line, individually quoted if [-d “$i...
Q: Assume that a train arrives from both directions and comes to a complete halt at the bridge, waiting...
A: Given that, two trains are arrives from both directions and comes to complete halt at the bridge wai...
Q: Create an entity relationship diagram and the relational diagram to show relationship between all th...
A: ERD :
Q: Computer Science What is an assembler directive? Give examples of assembler directive and its func...
A: Assembler directives are instructions that direct the assembler to do something. Assembler directive...
Q: predict the trajectory that AI will take over the next five years in mobile phones technology.
A: - We need to talk about the involvement of AI in next 5 years in mobile phone technology.
Q: I need a program that reads a 10-position vector and checks if there are equal values and writes the...
A: - We need to code for finding the equal values in an array in C.
Q: Given the problem of searching two arrays Input: arrays A and B of n integers each, and an integer t...
A: Given : for i<-1 to n do if A[i]==t then return TRUE end ifend for for i<-1 to n do if B[i...
Q: Write a yara rule to find PDF files with ANY of the following strings: - /JS - /JavaScript
A: What is YARA? Yet Another Recursive/Ridiculous Acronym (YARA) is a tool used to identify and classi...
Q: What is the time complexity (in big-O notation) of binary search in a sorted array containing m (m >...
A: SUMMARY: - Hence, we discussed all the points
Q: mory at base address 0x10001000. (10%) What is the address of the element myArray[77]? (10%) Registe...
A:
Q: 1 Convert the following base-2 numbers to base-10: (a) 1011001, (b) 110.0101, and (c) 0.01011. 2 Con...
A: 1. Converted the binary to decimal number
Q: tudy about a full virtualization based hypervisor and explain its working and ecture. (Please must e...
A: "Virtualized environments." A virtual machine, which itself is essentially a means of separating hel...
Q: teal your information
A: given - Enumerate and briefly discuss three tactics that an identity thief may use to steal your inf...
Q: I have a protein with an unknown function. To speculate about its function I want to search for its ...
A: Answer: Global Sequence Alignment Local Sequence Alignment 1. The entire sequence is attempted ...
Q: b qo 90 91 q1 91 92 92 2 92 The initial state is qo and the set of accepting states is F = {q2}. (a)...
A: a) State diagram for M is shown in Step 2 in the image attachment. b) ∂(q0, aab) is computed in the ...
Q: 6. Let M = (Q, E, 8, 90, F') be the DFA given by the state diagram: (a) Compute 8(q1, 110). (b) Dete...
A:
Q: 5-Integrated circuits made from CMOS are compatible with TTL IC's. This statement is A) True B) Fals...
A: the answer is givn blow:-
Q: Why run a k-Means cluster p that apply. O Find groups not explicit
A: Why run a k-Means cluster process on data? Select all that apply. Find groups not explicitly labeled...
Q: James River Jewelry is a small jewelry shop. While James River Jewelry does sell typical jewelry pur...
A: A. Write SQL CREATE TABLE statements for each of these tables. Answer) CREATE TABLE CUSTOMER ( ...
Step by step
Solved in 3 steps with 1 images
- Write a function that reads a single line of numbers from a file named "question1.txt", and returns the average of the numbers read. For example, if the file is as follows: ----- question1.txt -----1 3 5 -2 4 0 6 -2 -3------------------------- then the function must return 12/9 = 1.33333Write a function that reads a single line of numbers from a file named "question1.txt", and returns the average of the numbers read. For example, if the file is as follows: ----- question1.txt ----- 1 3 5 -2 4 0 6 -2 -3 ------------------------- then the function must return 12/9 = 1.33333 """ def file_average(): return # Remove this line to answer this questionImplement a function wordCount, which reads a text file, and returns thenumber of words in the file. You can assume the file only contains thealphabet characters and the space character. However there may be morethan one space character between two words, so “abc abc” and “abc abc”,for example, are both two words. int wordCount ( const char * filename ) {}
- 1. Write a function num_double to read file (f1.txt), double all the numbers, keep the string (no change), and write to another file (f2.txt), for example: >>># f1.txt-“I have 5 books and 3 pens...” >>> f2 = num_double(f1) >>> # f2.txt – “I have 10 books and 6 pens ...”Write a function that takes two lists of integers X and Y as input, and computes and writes a table into a file named "question2.txt" as follows: - On each line the computations for an X,Y pair is given Each such possible pair must exist in the file in the same order of values in X and Y Next on each line, you provide X+Y, X*Y and X^2 + Y^2, all separated by a comma (and no spaces or other characters must exist). Note that X^2 represents "square of X". For example, given X = [1,3] and Y=[-1,1,0], "question2.txt" should contain the following table: question2.txt 1,-1,0,-1,2 1,1,2,1,2 1,0,1,0,1 3,-1,2,-3,10 3,1,4,3,10 3,0,3,0,9 As you can see, the first line is computed for X=1, Y=-1. The second line is built for X=1, Y=1; and the third line is for X=1, Y=0. It goes on like this, until X=3, Y=0. def op2file(X, Y): in pythonWrite a function that takes two lists of integers X and Y as input, and computes and writes a table into a file named "question2.txt" as follows: - On each line the computations for an X,Y pair is given - Each such possible pair must exist in the file in the same order of values in X and Y- Next on each line, you provide X+Y, X*Y and X^2 + Y^2, all separated by a comma (and no spaces or other characters must exist). Note that X^2 represents "square of X". For example, given X = [1,3] and Y=[-1,1,0], "question2.txt" should contain the following table: ----- question2.txt -----1,-1,0,-1,21,1,2,1,21,0,1,0,13,-1,2,-3,103,1,4,3,103,0,3,0,9------------------------- As you can see, the first line is computed for X=1, Y=-1. The second line is built for X=1, Y=1; and the third line is for X=1, Y=0. It goes on like this, until X=3, Y=0.
- You are given a file consisting of students’ names in the following form: lastName, firstName middleName. (Note that a student may not have a middle name.) Write a program that converts each name to the following form: firstName middleName lastName. Your program must read each student’s entire name in a variable and must consist of a function that takes as input a string, consists of a student’s name, and returns the string consisting of the altered name. Use the string function find to find the index of ,; the function length to find the length of the string; and the function substr to extract the firstName, middleName, and lastName.Each line of a hockey file contains a four-digit year, a team name, and a two-digit number of wins.Here is one such file, hockey.txt:2003maple leafs452020maple leafs351995senators181996maple leafs302000senators482012canadiens48The first line of the file, for example, says that in 2003 (year), the maple leafs (team name) had 45 wins.Write a function that takes an open hockey file and returns a list of tuples,where each tuple refers to a team name and that team's maximum number of wins in any year.Here is a sample call of the function on hockey.txt:>>> teams_and_most_wins(open('hockey.txt'))[('maple leafs', 45), ('senators', 48), ('canadiens', 48)]"""from typing import TextIOdef teams_and_most_wins(f: TextIO) -> list[tuple[str, int]]:'''f is an open hockey file.Each year has 4 digits and each number of wins has 2 digits.Return a list of tuples where each tuple storesa team name and that team's maximum number of wins in any year.Every team should appear in exactly one of the…Write a cpp program that contains class “candidate”. A candidate has a name, number of electoral votes and number of popular votes.In your program, write a function that reads an input file containing elections results using input file stream and output to the console the name of the winner, his electoral votes and his popular votes.Your function should be prominent to faulty data; for example, if the number of votes for one of the candidates was a negative number, the function should exit and print a proper error message on the screen (You must use exceptions to do this)
- Write a function in python named "write_anagrams", that accepts a dictionary of anagrams and a filename. Write each set of anagrams out to a record in a CSV file with the specified name. The first word on each line should be the sorted word, followed by a count of the of the anagrams that include the same characters, e.g.: key,anagram_1,[anagram_2, ...] For example, there are 6 different words in words.txt that are anagrams for the key "aet": aet,aet,ate,eat,eta,tae,tea If any errors occur, print a detailed error message without crashing.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.You are given a file consisting of students’ names in the following form: lastName, firstName, middleName. (Note that some students may not have middle names). Write a program that converts each name to the following form: firstName middleName lastName. Your program must read each student’s entire name in a variable and must consist of a function that takes input as a string, consists of student’s name, and returns the string consisting of the altered name. Use the string function find to find the index of the function length to find the length of the string; and function substr to extract the firstName, middleName, and lastName. Test your program with a file consisting of the following names: Miller, Jason Brian Blair, Lisa Maria Gupta, Anil Kumar Arora, Sumit Sahil Saleh, Rhonda Beth