Define a Python function named expensive_counties that has two parameters. The first parameter is a string representing the name of a text file. Each line of this text file will be a state code. The second parameter is a string representing the name of a CSV file. The CSV file will be portion of the US government's dataset documenting median rents in each US county. Each row in the CSV file has the format: Area Name, Efficiency, 1-Bedroom, 2-Bedroom, 3-Bedroom, 4-Bedroom, State Code Your function will need to use the accumulator pattern to return a new list. You will need to add to this list the Area Name from every row that meets 2 criteria: (1) The state code (the column at index 6) was a line in the text file named in the first parameter; AND
Q: applications. Why? Could you explain this statement with valid reasons.
A: The answer is
Q: QUESTION FOUR a) Write the language produce EVEN-EVEN, of strings with even number of a’s and even n...
A: Here, we are going to define a regular language which will accept even number of a’s and even number...
Q: write a client-server program in C: Copy the program, compile and run(to ensure it is functional). H...
A: a client-server program in C client.c #include <stdio.h>#include <stdlib.h> #inclu...
Q: Alice and Bob use the ElGamal scheme with a common prime q= 131 and a primitive root a = 6. Let Bob’...
A: The answer is
Q: 1. How are TCP/IP Concepts helpful? How did the InfoSec Lab, Capturing and Analyzing Network Traffic...
A: 1) TCP/IP : The TCP/IP convention stack is comprised of four layers, that is datalink layer , networ...
Q: Explain the function of a domain controller in a Windows 2000 network. 5.Why is NDS (Novell Director...
A: The Windows Active Directory service is built around a domain controller. It secures a Windows domai...
Q: # Question 1 #Using the World database, in the city table, insert a new city for the Tasmania distri...
A: What is SQL: SQL is a language for interacting with databases. SQL is the standard language for rela...
Q: An HDD disk head is initially positioned over track 100 and is moving in the direction of decreasing...
A: #include <bits/stdc++.h>using namespace std; int size = 8;int disk_size = 200; void CSCAN(int ...
Q: What is the main idea of pseudoreplication in a mensurative experiment? GIve an example and explain.
A: Pseudo replication occurs when the observations are not statistically independent and this pseudo re...
Q: When the CMP instruction sequence is executed, what is the final value for AL register ? MOV AL, 25h...
A: 1) The CMP instruction compares two operands. It is generally used in conditional execution. Its syn...
Q: Name format: You must use String object and not StringBuffer or StringBuilder. Many documents use a ...
A: Step 1 : Start Step 2 : In the main method , declare the string variable to hold the name format. St...
Q: hat conditions would you argue in favor of building application software in assembly language code r...
A: Lets see the solution.
Q: E. The rational agent is: o An agent that act like humans o To selects actions that maximize its (ex...
A: Rational agents are used in machine learning so as to take the best decisions to optimise the resour...
Q: Calculate the Average turn around time and Average Waiting time of SRTF and SJF Process Queue Burst ...
A:
Q: -For each separate user task, include a use case diagram. -For each use case, specify a use case des...
A: Use case diagram is a behavioral UML diagram type and frequently used to analyze various systems. Th...
Q: In a huge organization, how does one go about obtaining approval for a network configuration change?
A: Introduction: When applying for a service provider shift in a large organization or company, you may...
Q: Given a linked list consists of data, a next pointer and also a random pointerwhich points to a rand...
A: Solution: Cloning in linked list- Cloning means copying the linked list without changing the structu...
Q: Breadth First Search can be modi ed to solve the problem: • Assume that you are given an undirected,...
A: Breadth First Search Algorithm: The BFS is one of most important searching technique in data structu...
Q: Write a program in the Python language to find the sum of all natural numbers in the range n to 150 ...
A: Write a program in the Python language to find the sum of all natural numbers in the range n to 150 ...
Q: Create a MATLAB program to read input the length of the side of a cube(in cm) and then it displays t...
A: Requirement: Create a MATLAB program to read input the length of the side of a cube(in cm) and then...
Q: QUESTION ONE (1) a, b q0 q1 q3 Figure 2 a) Based on Figure 2, find Q, E, 8, qo and F. b) Design an N...
A: Here, we are given a finite automata and asked the value of Q, Σ, δ, q0 and F. Finite automata is a ...
Q: Explain DMA. How it overcome the shortcomings of other two technologies?
A: Direct memory access (DMA) is a technique that allows memory to be accessed without going through th...
Q: Q9. Calculating the Big-O of algorithms is a process that helps to compare the performance of algori...
A: Big O algorithm is a numerical documentation that portrays the restricting way of behaving of a capa...
Q: Calculate the Average turn around time and Average Waiting time of SRTF and SJF Process Queue Burst ...
A: SRTF - It is a preemptive version of SJF. SRTF stands for Shortest Remaining Job First. In this algo...
Q: Write a program that generates 100 random integers between 100 and 1000 inclusive and displays the n...
A: I have provided PYTHON CODE along with CODE SCREENSHOT and also provided OUTPUT SCREENSHOT...
Q: Write a Java program to search an element in an sorted array. You have to take the sorted array from...
A: Write a Java program to search an element in a sorted array. You have to take the sorted array from ...
Q: When surfing online, you get some strange data on an apparently secure website, and you realize you ...
A: Answer :
Q: Compare between pipeline machine and non-pipeline machine. Suppose there are 16 instructions in a pr...
A: Here is the solution.
Q: ?++What is the correct syntax of accessing a static member of a class in C class A public: static in...
A: A::value
Q: films for a given film category. Example: getFilmCount('Action') Put the screenshot of the i...
A: Function: delimiter // CREATE PROCEDURE getFilmCount (IN catName CHAR(10), OUT filmCount INT) BEGIN ...
Q: list and describe eight of the most important computer architecture concepts?
A: The Answer is in Below Steps
Q: Write a program that generates 100 random integers between 100 and 1000 inclusive and displays the n...
A: Program: #include <iostream>using namespace std;int main() { srand((unsigned) time(NULL)); ...
Q: Consider the following directed search graph where S is the starting node and Gl and G2 are goal nod...
A: Given G1 and G2 are the goal nodes S is the starting node.
Q: What is the first general-purpose computer which consumes a huge room as its storage? a) EDVAC b) EN...
A: Your answer is given below with explanation.
Q: Convert the following Ruby statement to Python: Statement sequences as clauses: Ruby if s...
A: In Python indentation plays a major role which indicates the start and end of block and thus end is ...
Q: In what instances would you argue in favor of creating application software in assembly language cod...
A: Assembly Language: Assembly language was created to be alleviate some of the issues with machine lan...
Q: You are given a binary array containing only 0's and 1's. You have to sort the array and you can swa...
A: Required:- You are given a binary array containing only 0's and 1's. You have to sort the array and ...
Q: Write a recursive method toNumber that forms the integer sum of all digit characters in a string. Fo...
A: Recursion is a process in which a method calls itself continuously.
Q: If the bit pattern in Register7 is 95 and the bit pattern in Register8 is EE, what would be the bit ...
A: The Answer for the given question in step-2.
Q: What are the four responsibilities that every router has?
A: Introduction: Router: It is a network device that forwards data packets. It forwards data packets f...
Q: Explain why 4,294,967,295 is the maximum number that can be represented by an unsigned long variable...
A: Here, we are going to explain about unsigned long and int data types and their range.
Q: Alice and Bob use the ElGamal scheme with a common prime q = 131 and a primitive root a = 6. Let Bob...
A: The answer is
Q: 1. What is Failover-Clustering and why do you think it is so widely used?
A: Failover clustering is Microsoft's implementation of the high availability cluster method for provid...
Q: Define the concept of a unified memory architecture.
A: The goal of unified memory is to reduce data redundancy by copying data between separate areas of me...
Q: A program is required to read from the screen the lenghth and width of a rectangular house block, an...
A: The Answer for the given question is start from step-2.
Q: Suppose you start with an empty queue and perform the following operations: enqueue 1, dequeue, enqu...
A: In step 2, I have provided correct answer with brief explanation ---- In step 3, I have pro...
Q: write a program to implement an genetic algorithm that targets a number n (where n will be user inpu...
A: The Python program to solve the given problem is below.
Q: Consider the following scenario: you get a message from your company's mail server informing you tha...
A: Introduction: The phishing attack is a sort of malware that involves password hacking. The computer ...
Q: What is the catastrophe recovery process's principal objective?
A: The solution to the given question is: introduction- Catastrophe recovery/Disaster recovery : Disas...
Q: Based on Figure 1, identify the FIVE (5) strings which are 0001, 01001 , 0000110, 11100 and 1101010 ...
A: Given DFA contains Q: finite set of states = { q0, q1, q2 } ∑: finite set of the input symbol = { 0...
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Python Previously, your check_move function took two separate arguments: a column and a row value. Now you will rewrite the function to accept the board position as a single string argument. In other words, write check_move (position) which takes position strings such as '85" that include both the column and the row value of a chess board. • When both the coordinates in position are valid, for example, "c4", the function returns 'The piece is moved to C4.'. • If position has too many or too few characters, return 'The position is not valid.' • If the first coordinate is out of range (regardless of whether the second one is or not) return 'The column value is not in the range a-h or A-HI¹. . Otherwise, if the second coordinate is out of range, return 'The row value is not in the range 1 to 81¹. Note that, irrespective of the casing of the column value, your code should output the value in upper case. Your function should work like this: >>> check_move('B4') 'The piece is moved to B4.'…In C programming language Question (Strings) Write a function find_Substring() that finds a substring into a string. Pass array s1 and s2 to this function and prints if the substring is present or not. Expected Output 1: Enter string This is a javascript Enter substring script The substring is present Expected Output 2: Enter string This is a javascript Enter substring Jscript The substring is not presentJavaScript repl For this question you will need to use the following function: • string_value.replace(/x/g,"y") returns the text in string_value except that any instance of x is replaced by y Define a function named canadianize which has one input. The input is a str and its value will be some text. The function will return that text canadianized into Canadian English. Write your function so that it starts by getting the result of replacing all of input's instances of "hat" with "tuque". Use the result of that initial function call, replace all instances of "! "with ", eh? " (note that both strings end with a single space). Your function should return the Canadian English str. Sample test cases: canadianize("Even though I hate covering my head, it was cold so I wore a hat.") would evaluate to "Even though I tuquee covering my head, it was cold so I wore a tuque." (finds bug if "hat" not replaced correctly as part of another word) canadianize ("It's cold as all get out! ") would…
- vowelIndex Write a function vowelIndex that accepts a word (a str) as an argument and returns the index of the first vowel in the word. If there is no vowel, -1 is returned. For this problem, both upper and lower case vowels count, and 'y' is not considered to be a vowel. Sample usage: >>> vowelIndex('hello') 1 >>> vowelIndex('string') 3 >>> vowelIndex('string') 3 >>> vowelIndex('BUY') 1 >>> vowelIndex('APPLE') 0 >>> vowelIndex('nymphly') -1 >>> vowelIndex('string')==3 True >>> vowel Index ('nymphly')==-1 TrueCreat a program which can process multiple groups. These groups are on the input separated by ’=\n’. Every group starts with a first line that contains the name of the group and the lines after contain the information about the students in the same way as the text file. The program needs to be written in Python, and needs to make use of functions and input parsers. With the input 1bErik Eriksen__________4.3 4.9 6.7Frans Franssen________5.8 6.9 8.0=2bAnne Adema____________6.5 5.5 4.5Bea de Bruin__________6.7 7.2 7.7Chris Cohen___________6.8 7.8 7.3Dirk Dirksen__________1.0 5.0 7.7 The output should be: Report for group 1bErik Eriksen has a final grade of 6.0Frans Franssen has a final grade of 7.0End of reportReport for group 2bAnne Adema has a final grade of 6.0Bea de Bruin has a final grade of 7.0Chris Cohen has a final grade of 7.5Dirk Dirksen has a final grade of 4.5End of reportPython task You must write a function control (p_nr) that calculates and returns the control digit in a 10-digit social security number if you send in the first 9 digits in the form of a string. The rules for calculating the check digit in a social security number are as follows:The numbers are multiplied alternately by 2 and 1 and then the products are summed. For a two-digit product, the sum of its numbers is calculated. The sum is then subtracted from the nearest higher tens to obtain the check digit.To calculate the check digit for the social security number with the first 9 digits 811218987, perform the following setup: 8 1 1 2 1 8 9 8 7 2 1 2 1 2 1 2 1 2 16 1 2 2 2 8 18 8 141 + 6 + 1 + 2 + 2 + 2 + 8 + 1 + 8 + 8 + 1 + 4 = 44The check digit is 50-44 = 6 # test personal_number = input () control_digit = control(personal_number) print(control_digit)
- Assume that you have a data structure of the following: A list of hockey players. Each hockey player is a list that includes their Rank (int), Name (String), Team (String), Age (int), Goals (int), Assists (int), Points (int) in that order. Write a function called most_goals that takes in the list of hockey players and returns the name of the player with the most goals. solve in python programming languageInstructions Write a function create_password() expects two parameters: pet_name (a string) and fav_number (an integer). The function returns a new password generated using the following pattern: fav_number followed by the pet_name followed by the star * and fav_number again (see the example below). Create a program that gets a pet name and a favorite number as input from the user, calls the above function, and then prints the output as shown below. Example Input: Angel 3 Output: Your new password is "3Angel*3". Note that the double quotes are part of the output. The assert in the provided template is checking that this function call is returning the correct value (i.e., a correctly-formed string). assert create_password("Angel", 3) == "3Angel*3" Hints Remember that you cannot directly concatenate an integer and a string - you need to convert an integer into a string using either str() or by using f-strings. Troubleshooting If you are getting AssertionError make sure that your…Write a program that reads in a line consisting of a students name, Social Security number, user ID, and password. The program outputs the string in which all the digits of the Social Security number and all the characters in the password are replaced by x. (The Social Security number is in the form 000-00-0000, and the user ID and the password do not contain any spaces.) Your program should not use the operator [] to access a string element. Use the appropriate functions described in Table 7-1.
- Complete the zero_extend_number() function that takes two parameters: • The integer parameter number which represents the number that needs to be zero-extended • The integer parameter length which represents the length of the number string that the function needs to return. The function returns a string representation of the parameter number with the length specified by the parameter length. If the number of digits in number is less than the length, then the function will need to zero-extend number by appending the required number of zeroes to the front of it. You can assume that the parameter length will always be greater than or equal to the number of digits in number. Some examples of the function being used are shown below: For example: Test Result print(zero_extend_number (1, 5)) 00001 print(zero_extend_number(10, 4)) 0010 Answer: (penalty regime: 0 %) Reset answer 1 v|def zero_extend_number(number, length):Average grades bar chart Write a python program grades.py that reads a file of assignment grades and draws a bar chart of the average grades for each assignment. Save the figure as grades.png in the current working directory. The format of a line in the file is: assignment_type grade Note that there is a single space between the assignment type and the grade. E.g. exam 92.80 Your program must contain the following functions: Function name Function description Function input(s) Function return value(s) get_grades() This function takes a file name as input and populates a dictionary containing the assignment types and grades. Filename string Dictionary of grades main() This function prompts for the grades file name. Next, it calls the functions get_grades(). Next, it draws the bar chart of the average grade for each assignment. Hint: You can use the mean function of the statistics module to calculate the average of a list. None None Use the starter…C++ Provide a different implementation of ChoiceQuestion. Instead of storing the choices in a vector, the add_choice function should add the choice to the question text. For this purpose, an add_line function has been added to the Question class. Complete the following file: choicequestion.cpp Use the following files: choicequestion.h #ifndef CHOICEQUESTION_H #define CHOICEQUESTION_H #include <string> using namespace std; #include "question.h" class ChoiceQuestion : public Question { public: /** Constructs a choice question with a given text and no choices. @param question_text the text of this question */ ChoiceQuestion(string question_text); /** Adds an answer choice to this question. @param choice the choice to add @param correct true if this is the correct choice, false otherwise */ void add_choice(string choice, bool correct); private: int num_choices; }; #endif question.h #ifndef QUESTION_H #define QUESTION_H #include <string> using namespace std; class Question {…