import Prelude hiding (lookup) data Exp = Num
Q: Race.RaceDate is not nullable Questions: Question 10 What constraints would the following command vi...
A: Here i give answer one by one(According to guidelines we solve first three): =======================...
Q: he source IP address for an IPv4 datagram is stored where in the header?
A: c. 4th longword (bytes 13-16) The answer is 4th longword ( bytes 13-16) The ip datagram consistm o...
Q: Breaking the Code by CodeChum Admin ATTENTION SOLDIER! This will be the hardest mission of your ...
A: Here I have created the function hasConsonant(). In this function, I have created a loop to traverse...
Q: 14) Suppose FSA M1 and M2 are defined as follows: M1(Q, S, qo, A, 8) = ({I, II, III }, {a, b}, I, {I...
A: According to the information given:- we have to follow the instruction and perform the task.
Q: What components must a PHP program that enables a dynamic Web site contain?
A: Introduction: PHP stands for "PHP: Hypertext Preprocessor." PHP is a popular open-source programming...
Q: Is there a list of the hard drive's contents?
A: A hard drive is secondary storage which stores data permanently.
Q: Client host Server host 2 3 5 ...
A: Solution:
Q: 3. Is Recursive Descent Parser (RDP) more powerful than LL(1) parser ( or LL(1) is a subset of RDP)?...
A: answer is
Q: [RC4) RC4 is a stream cipher standard that was used widely on the Internet. Read the below pseudocod...
A: Here i explain about RC4: ==========================================================================...
Q: The job of the __________ is to fetch instructions, carry out the operations commanded by the instru...
A: Lets see the solution.
Q: What does it mean to “visualize a program running”? What is the value of suchan activity?
A: Lets see the solution.
Q: What is the source of your computer's strength?
A: The computer's capabilities are built on three primary characteristics: its ability to calculate, it...
Q: Which of the following is T(n)=4T(n/2) + log n A) 0 (n2) B) 0(n² log n) C) 8 (2") D) 0 (n!)
A: T(n) = 4T(n/2) + n² ---- (1) Now, T(n/2) can be further divided as T(n/2) = [4T(n/4) + n²/4] So, equ...
Q: The Python programming language is what I'm interested in."
A: A scripting language written in Python Because of its complexity, Python is referred to be a high-le...
Q: When the performance of the whole system is dependent on the correct operation of all of its compone...
A: Let's understand parallel processing: Parallel processing can be described as a class of techniques ...
Q: You are to use the started code provided with QUEUE Container Adapter methods and provide the implem...
A: //used headesr#include<iostream>#include<string>using namespace std; //queueu structstru...
Q: At the time of its conception, how large was the computer?
A: Introduction: ENIAC-Electronic Numerical Integrator and Computer was one of the first electronic dig...
Q: Describe the advantages of three-tier architectures.
A: Lets see the solution.
Q: The Python programming language is what I'm interested in.
A: Introduction: It is possible to write machine code from texts or graphical program components in the...
Q: Step-By-Step Assignment Instructions Assignment Topic: How data breaches occur and are discovered....
A: In questions with many questions, we must answer the first one. А dаtа breасh оссurs when inf...
Q: Write a brief description for WriteChar.
A: The function of which the main file that can be specified as the main ASCII code as the main convert...
Q: We replaced the bios of my laptop but still no display but has power in all the systems. What is the...
A: According to the information given:- We have to find the issue in no display problem.
Q: What database APIs are commonly used to access databases from various programming languages?
A: Lets see the solution.
Q: le discussed in class that with n agents, there are n! permutations of agents which n! different det...
A: Pareto ideal A Pareto diagram is a reference chart. The lengths of the bars address recurrence or co...
Q: Let X and Y be two arrays. Let them contain the same distinct k keys but the keys are ordered differ...
A: prefixAverages(X,Y,n) Input array X,Y and n integers Output array X,Yof n doubles Let X,Y be an a...
Q: What will be the impact of quantum computing on programming?
A: Computing power is growing exponentially, both in the number of transistors that can be packed onto ...
Q: Consider the following function: int get_random(int start, int end){) int * rand_int = new int; std:...
A: We nee to answer: Consider the following function: int get_random(int start, int end){ int * rand_in...
Q: Is a syntax error (such as misspelling a key word) found by the compiler or when the program is runn...
A: Lets see the solution.
Q: e 3 microp
A: Below the 3 microprocessor operations
Q: What is the first sector of a PC hard disc?
A: What is Sector in PC Hard Disk? A sector is a specifically sized division of a hard disk drive, opti...
Q: Describe the disadvantages of three-tier architectures.
A: Lets see the solution.
Q: What problems can arise during view integration or merging relations?
A: Lets see the solution.
Q: Explain the difference between an object file and an executable file.
A: Lets see the solution.
Q: Create a simple webpage that allows users to create and input data in a Form. it must contain your ...
A: HTML Code: <html><head><title>Login Page</title></head><style>.b...
Q: Write an algorithm to find the maximum in an array
A: Dear student, As per guidelines, I can do only first question. Please re-post your pending question ...
Q: What are the problems involved with mixed data? Discuss with suitable examples four ways of converti...
A: Mixed data is a data that is created from multiple sources, each of which may have different attribu...
Q: Q4. Why does kernel need data structure? If O means busy and 1 means free, what does 1001101 bitstre...
A: Kernel needs data structure to store about the current state of the system. That means if any new da...
Q: What are VLANs? copy/paste 3 VLANs separated by routers. Why are Vlans important and on what layer...
A: basic definition of vlan and its importance with types.
Q: User authoriza Input validatio
A: NOTE: ACCORDING TO COMPANY POLICY WE CAN SOLVE ONLY 1 QUESTION. YOU CAN RESUBMIT THE QUESTION AGAIN ...
Q: Provide a brief description for ReadDec.
A: The ReadDec in leading spaces are ignored.
Q: In what ways are computer structure and computer function distinguished from one another?
A: Computer Systems: The system is a term used in computer science to refer to desktop computers. Gener...
Q: Concisely define each of the following keydatabase design terms: relation, primarykey, functional de...
A: Lets see the solution.
Q: 1 Write a python program that will calculate the function exp(x) Make sure your program meets...
A: 1. code: import mathdef expo(x): summ = 0.0 n = 0 while math.exp(x) - summ > 0.0000001...
Q: wer the following: Let R be a subset of pixels in an image. We call R a region of the image if R is ...
A: Neighbors of a Pixel . N4 (p) : 4-neighbors of p.• Any pixel p(x, y) has two vertical and two flat n...
Q: Why must programs written in a high-level language be translated into machine language before they c...
A: Lets see the solution.
Q: Complete the below function in Python language def checkPassword(pass): #pass must have length betwe...
A: Required:- Complete the below function in Python language def checkPassword(pass): #pass must have a...
Q: Given the following function: f(a, b, c, d, e) = abcē + bad + čēbd + ade + āce Use Shannon's expansi...
A:
Q: Instructions: 1. Create a console program that will perform the following: • Ask the user to enter f...
A: To print message on screen, Console.WriteLine function is used To take input from user, Console.Read...
Q: 3. Evaluate the following expressions: a. abs(5); _______________________________ 88 b. floor(5.5); ...
A: a. abs(5); __________5_____________________b. floor(5.5); __________5_____________________c. ceil(5)...
Q: The process control block (PCB) is a critical part of process management. Discuss the relevance of t...
A: Role of PCB in management of processes and resources is mentioned below,
import Prelude hiding (lookup) data Exp = Num Int | Add Exp Exp | Sub Exp Exp | Mul Exp Exp | Div Exp Exp | Var String | Let String Exp Exp | App Exp Exp | Fnc String Exp deriving (Show) type Env = [(String, Val)] data Val = CVal Int | FnVal String Exp Env | Error String deriving (Show) {-Implement a function lookup:: Env -> String -> Val that looks up the value of a variable within a context. This function returns the value of the variable if found and returns an error otherwise. -} lookup :: Env -> String -> Val -- code here-- {- Implement a function eval:: Exp -> Env -> Val to evaluate an expression with an initial context and return a value. Errors occur in the following cases: (a) Left-hand-side of a function application is not a function. (b) Use an undefined variable (c) Arithmetic expression where operand is not a number -} eval :: Env-> Exp -> Val
-- code here --
Step by step
Solved in 2 steps
- java Use Map data structure Write a method that returns the frequency of each characters of a given String parameters If the given String is null ,then return nulldef q5(sentence): Assumes sentence is a string. Returns a list of all the words in sentence, where a word is a token separated by white space, (you can use sentence.split()), and then for each word, make it lowercase and remove any character that is not alpha-numeric (a-z or 8-9). For example, I q5("The Plague" (French: "La Peste"), 1947, by Albert CamUs.') should return ['the', 'plague', 'french', 'la', 'peste', '1947', 'by', 'albert', 'camus'] q5('Red@Dragon....ca is great!') should return ['reddragonca', 'is', 'great'] passRevorse the vewels def reverse_vowels(text): Given a text string, create and return a new string constructed by finding all its vowels (for simplicity, in this problem vowels are the letters found in the string 'aeiouAEIOU') and reversing their order, while keeping all other characters exactly as they were in their original positions. However, to make the result look prettier, the capitalization of each moved vowel must be the same as that of the vowel that was originally in the target position. For example, reversing the vowels of 'Ilkka' should produce 'Alkki' instead of 'alkkI'. Applying this operation to random English sentences seems to occasionally give them a curious pseudo-Mediterranean vibe.Along with many possible other ways to perform this square dance, one straightforward way to reverse the vowels starts with collecting all vowels of text into a separate list, and initializing the result to an empty string. After that, iterate through all positions of the original text.…
- Revorse the vewels def reverse_vowels(text): Given a text string, create and return a new string constructed by finding all its vowels (for simplicity, in this problem vowels are the letters found in the string 'aeiouAEIOU') and reversing their order, while keeping all other characters exactly as they were in their original positions. However, to make the result look prettier, the capitalization of each moved vowel must be the same as that of the vowel that was originally in the target position. For example, reversing the vowels of 'Ilkka' should produce 'Alkki' instead of 'alkkI'. Applying this operation to random English sentences seems to occasionally give them a curious pseudo-Mediterranean vibe. Along with many possible other ways to perform this square dance, one straightforward way to reverse the vowels starts with collecting all vowels of text into a separate list, and initializing the result to an empty string. After that, iterate through all positions of the original text.…Lottery Ticket Challange- Python Coding I have coded... import random#listspick=[]rand_ticket=[]#variables#writeoutFile = open("lotteryTicket.txt","w")count=0ticket=""while count < 3:ticket=(int(input("Enter a 1 digit number:")))ticketList=pick.append(ticket)count=count+1outFile.write(str(ticket)+"\n")outFile.close()#print out the numbers they pickedprint("Your ticket number is %s"%(pick))#read the fileinFile = open("lotteryTicket.txt","r")line = inFile.readline()while (line):line = inFile.readline()count2=0while count2<3:rand_ticket.append(random.randint(1, 9))count2+=1print("The winning ticket is %s"%(rand_ticket))#compare numbers complete this code to... Compare the text ticket and the random numbers. If they match number (see below), output the prize The numbers can be in any order the random numbers can be duplicates, so be careful how you count One number match - free ticket Two numbers match - $2.00 Three numbers match - $10.00def strPattern(mystr):lenght = len(mystr)mystr1 = ""for i in range(lenght - 1):mystr1 = mystr1 + mystr[i].upper() + str(i + 1)if lenght == 0:return mystr1return mystr1 + mystr[-1].upper()s = input("enter a word: ")print(strPattern(s)) s = input("enter a word: ") EOFError: EOF when reading a line HOW CAN I FIX THIS QUESTION?
- Given: String[] name={"John", "Mary", "Jim", "Sam"}; Which one is correct: name[1]="Mary" name[1]="John" name.get(1)="Mary" name.get(1)="John"# define stemmer functionstemmer = SnowballStemmer('english') # tokenise datatokeniser = TreebankWordTokenizer()tokens = tokeniser.tokenize(data) # define lemmatiserlemmatizer = WordNetLemmatizer() # bag of wordsdef bag_of_words_count(words, word_dict={}): """ this function takes in a list of words and returns a dictionary with each word as a key, and the value represents the number of times that word appeared""" for word in words: if word in word_dict.keys(): word_dict[word] += 1 else: word_dict[word] = 1 return word_dict # remove stopwordstokens_less_stopwords = [word for word in tokens if word not in stopwords.words('english')] # create bag of wordsbag_of_words = bag_of_words_count(tokens_less_stopwords) Use the stemmer and lemmatizer functions (defined in the cells above) from the relevant library to find the stem and lemma of the nth word in the token list. Function Specifications: Should take a list as input and…a) FindMinIterative public int FindMin(int[] arr) { int x = arr[0]; for(int i = 1; i < arr.Length; i++) { if(arr[i]< x) x = arr[i]; } return x; } b) FindMinRecursive public int FindMin(int[] arr, int length) { if(length == 1) return arr[0]; return Math.Min(arr[length - 1], Find(arr, length - 1)); } What is the Big-O for this functions. Could you explain the recurisive more in details ?
- Separate Count You are given a string as input from the user which contains the brackets {}() []. You have to write a program that prints the count of the brackets (, ), {, }, [, ] separately in the given order. Refer to sample output. Sample Case: Input: ({)[[)]({[]) Output: (->2 ) -> 3 {-> 2 }->2 [ -> 3 ]->2dictionaries = [] dictionaries.append({"First":"Bob", "Last":"Jones"}) dictionaries.append({"First":"Harpreet", "Last":"Kaur"}) dictionaries.append({"First":"Mohamad", "Last":"Argani"}) for i in range(0, len(dictionaries)): print(dictionaries[i]['First']) ************************************************* please modity the above code to "Add an ‘if’ statement(s) to the loop in your solution in Exercise 7 to only show the full name if the first name is “Bob” or if the last name is “Kaur”.dictionaries = [] dictionaries.append({"First":"Bob", "Last":"Jones"}) dictionaries.append({"First":"Harpreet", "Last":"Kaur"}) dictionaries.append({"First":"Mohamad", "Last":"Argani"}) for i in range(0, len(dictionaries)): # Condition that's print the full name when Condition is True if(dictionaries[i]['First']=='Bob')or(dictionaries[i]['Last']=='Kaur'): print(dictionaries[i]['First']+" "+dictionaries[i]['Last']) ********************************** please modify the code to use a while loop instead of a for loop