Please answer both questions.
Q: Consider the following context free grammar in BNF form for simple English sentences: (r1) →…
A: SOLUTION
Q: Complete the following fragment of a program that asks for an integer from 1 through 3 (including 1…
A: The while loop should run till the user enters any number out of the range of 1-3.
Q: What are the differences between ‘data warehouse’ and ‘operational database’
A: The distinctions between an operational database and a "data warehouse" Data Warehouse :1. In…
Q: Q.14 List and explain various Implementation techniqués used for dialog modeling in UIMS.
A: Menu Network: It is made up of Menu trees or Also called "Dialog Trees" It is a hierarchical setup…
Q: Look at the directed graph in the file Quiz TestGraph.pdf on Brightspace. The vertices a, b, c, d,…
A: ba, gd Given graph is a directed graph which contains, 8 vertices that are a, b, c, d, e, f, g, h.…
Q: 1. Write a SELECT statement that returns two columns based on the Vendors table. The first column,…
A: Add a column to the query described in exercise 2 that uses the RANK() function to return a column…
Q: Question 5 How is propagation delay affected if the length of the packet is increased?
A: Dear Student, The answer to your question along with complete explanation is given below -
Q: The following recursive function takes three positive integer arguments: def compute(n,x,y) :…
A: The screenshot of the Python program for the given problem along with the output is as follows: In…
Q: import random def create_dna(n, alphabet=’acgt’): return ’’.join([random.choice(alphabet) for i…
A: Please find the answer below :
Q: he fairies in Fairyland are getting ready to compete in the Fly High game where the fairy that flies…
A: import random def main(): highest = 0 name = "" while True: fairy = input("Enter a…
Q: Multiple Choice Powershell d.In PS, there is a commandlet that can tell what user has logged in…
A: The above question is solved in step 2 :-
Q: What is the idea behind distributed query processing using the semijoin operation? Write your answer…
A: Answer:
Q: Using c++, write a function called minIndex that accepts a 1D array of integers "a" and an integer…
A: Using c++, write a function called minIndex that accepts a 1D array of integers "a" and an integer…
Q: What is Hyper Threading? What is the use of it?
A: Answer the above question are as follows
Q: Problem_#08] Determine the decimal value of the signed 2's complement form. (a) 10011001 (b)…
A:
Q: Suppose three algorithms A, B, and C, can be implemented to perform a task. The algorithms have the…
A: Time Complexity :- Time complexity is the length of time an algorithm takes to run as a function of…
Q: Create the database with these tables using SQL commands. Prefix the table names with project_.…
A: Note: since you have not include sample data that to be insert's we have provided datatype that are…
Q: Question - 3 Suppose there is exactly one packet switch between a sending host and a receiving host.…
A: solution
Q: Explain advantages of constructing user Interfaces with a - UIMS.
A: Please find the answer below
Q: What are the specific pros and cons of single sourcing cloud services on a single cloud provider?…
A: I have given answer below.
Q: If the following code, what will be the variable "value" equal to when y=2 is being executed: def…
A: The question has been answered in step2
Q: Write an algorithm for divide-and-conquer technique for finding the position of the largest element…
A: Algorithm for finding the position of the largest element: Input is a portion of the Array between…
Q: WorksOn Database: Employee (EmployeeNumber, EmployeeName, BirthDate, Title, Salary,…
A: Dear Student, SQL query for each question is given below and the queries are self explanatory.
Q: array Elite School Bus Services provide bus services for the route from point 0 to school as stated…
A: Below I have provided a program for the given question. Also, I have attached a screenshot of the…
Q: IN HLA CODE PLEASE PROGRAM Three Zero Game Write a HLA program that reads a number. Then by…
A: The above question is solved in step 2 :-
Q: j = while j > 0: k = 0 while print("#", end = k = k + 1 print () j = j - 1 Complete the program so…
A: First blank: while(j < 5): ------ Second blank: while(k <= j) --+---&- Here we need to…
Q: More than 90% of the microprocessors/micro-controllers applications. Why? Could you explain this…
A: Solution : One option for developing an embedded system is to base the computational hardware on a…
Q: Question 5 Write a program that reads 10 characters from the keyboard and then print the…
A: Python : The programming language Python supports multiple paradigms. Fully supported are structured…
Q: R/M 000 001 010 011 100 101 110 111 MOD = 11 W=0 AL CL DL BL AH CH DH BH W = 1 AX CX DX BX SP BP SI…
A: ANSWER:
Q: A Queen on a chessboard can attack any piece in the same column, row or diagonal. The N-Queens…
A: Solution- In the above program we give an two differ output of N- queen as one for display the…
Q: What is SCSI? Is the SCSI Hard Disk is needed for a home purpose?
A: SCSI: SCSI in context of the computer system stands for Small Computer System Interface. SCSI…
Q: What is the subnet mask of the given network? A. 255.255.240.0 B. 255.255.5.0 C. 172.16.255.0 D.…
A: An IP address or Internet Protocol address is a series of numbers that identify each device on a…
Q: without truth table. show that ¬(¬p V q) ^ ¬p is a contradiction.
A: These question answer is as follows,
Q: What should the loading factor be (on ANY HASH TABLE) if you want to have an average of 1.4…
A: The average comparisons are: 1/2 (1+1/1-λ) The average is 1.4 (given in question) so loading factor…
Q: Exercise 2: Find the Taylor series for the following functions Sin x Cos x Tan x 3 e-x please make…
A: Answer:
Q: plication ts data a very k time units, where k is sm hing for a relatively long period oket suitchod…
A: A packet-switched network would be more appropriate for this application because it is more…
Q: How can a 250 GB solid state drive be removed from a computer in the safest possible way without…
A: Solid-state drive It is another age-of-capacity gadget utilized in PCs. Solid-state drive store…
Q: Question 1 A-Describe section 230 of the Communications Decency Act. B- make an argument for or…
A: No user or supplier of an interactive computer service will be regarded as the publisher or speaker…
Q: What's the output of? #print("Hello, World!") Error O No output #print("Hello, World!") Hello,…
A: The Answer is " No output " because it is a comment. In python, we use # symbol for comment…
Q: In Speed how SATA is different from IDE?
A:
Q: Convert the Assembly Language Instruction MOV SI,[BX+2] to Machine Language Instruction
A: Given: We have to Convert the Assembly Language Instruction MOV SI,[BX+2] to Machine Language…
Q: Briefly summarize in your own words the five tenets of the Code of Fair Information Practices.
A: In this question we need to explain the five tenets of Code of Fair Information Practices related to…
Q: What is human memory? Explain types of memory.
A: Human memory is a powerful mental process which takes information from the world and then processing…
Q: 4. Problem 4: Consider the function f(x, y) = cos(0.2(x - 1)² +0.5(y-2)2)e-²-y² 1) Plot the function…
A: # This is the code required for python plotting # Import libraries from mpl_toolkits import…
Q: Given a large list of positive integers, count the number of k-subsequences. A k-subarray of an…
A: Dear Student, As no programming language is mentioned I am assuming it to be C++.
Q: Write a method named computeTax that accepts a salary as a parameter and that returns the amount of…
A: The method will accept an integer parameter salary and returns the double parameter tax So, the…
Q: 1. fInd the average win and lose rate of the crabs game 2. Find the Mean, Median, and mode of how…
A: In this question, it is asked to provide the python code for a problem statement. The statement asks…
Q: Provide a different implementation of ChoiceQuestion. Instead of storing the choices in an array…
A: Question.java: public class Question { private String text; private String answer; public…
Q: Facilities / Activity: Computer laboratory Known or expected hazards: 1. Ergonomics (Work-Related…
A:
Q: A communication line capable of transmitting at a rate of 50 Kbits/sec will be used to accommodate…
A: A. The arrival rate is lambda = 150/60 = 2.5 packets/sec for each session. 10 lines with a 5 Kbps…
Please answer both questions.
Step by step
Solved in 2 steps
- -Python- Write a function get_letter_grade, such that when given * a lab grade score and * a list of the grade cutoffsreturns the letter grade of that score.Note: Your function automatically returns A for the values that are >= to the first cutoff-value in the list, then A- for the second cutoff-value, B+ for the third and so on. The function returns None for anything that's below the score for B-. You test that get_letter_grade(97, [93, 90, 87, 83, 80]) correctly returns an A, and get_letter_grade(93, [97, 90, 87, 83, 80]) returns A-. DO NOT hard-code the cutoffs, since they can change! You can copy/paste the following template: def get_letter_grade(score, cutoffs): if score ... : return 'A' ...: return 'A-' ...: return 'B+' ...: return 'B' ...: return 'B-'function [P, A] = rect(L, W) P= 2 (L+ W); A =L*W; end Above function is defined to find perimeter and area of a rectangle. If a rectangle has length 10 mm and width 7 mm then the correct way to get perimeter and area of a given rectangle by executing this function is Select one: a. [A, B] = rect(10, 7) b. rect(7, 10) c. [A, B] = rect(7, 10) d. rect(10, 7)Write a function verifsort that accepts a list as a parameter, check if the list elements are sorted and returns: 1 - if the list is sorted in ascending order, 2 – if the list is sorted in descending order, and 0 – if the list is not sorted. Write a function listsort which accepts a list as a parameter, and sorts it in ascending order. You can use any standard sorting algorithm, but don’t use built-in sort methods and functions. The function must sort and return the list. Write a script that asks user to enter 10 integer numbers, creates a list from those numbers, then calls verifsort function to detect if this list is sorted, prints message (list is sorted or list is not sorted) and if it’s not sorted then calls listsort function and prints the sorted list after listsort
- int getMax(int arr[], int n) { intmx=arr[0]; for (inti=1; i<n; i++) if (arr[i] >mx) mx=arr[i]; returnmx; } Can u give me the code for this one as well....this is the first function and countsort is the secondWhat does this function do? def f2(s): i=len(s)-1 while(i>=0): print(s[i),end=") i=i-1 A) It prints the reverse of its parameters B) It counts the number of 'a' characters in its parameter s It counts the number of 's' characters in its parameter s It prints its parameter s Question 6 What's wrong with this code? i=10 while(i>100): print('Ali') i=i+1 It produces nothingPart (a) Write a python function that computes the binomial coefficient ("). The function should return the correct answer for any positive integer n and k where k=m pass Part (c) Suppose that the number of people in the trial is 100. Then: • Plot a curve that shows how the probability of type 1 error changes with the choice of m, for m = 1,...n assuming that the null hypothesis holds (in red), • On the same picture, plot the probability of type 2 error vs the value of m in the case in which the new drug is effective with proability 0.68 (in blue). You can plot the two curves using matplotlib.pyplot. You can select the color by passing color='r' or color='b' to the plt.plot() function. [4]: n - 100 # your code here def plot_curve (): pass [5]: plot_curve() Part (d) Based on the picture above, what value of m do you think would be suitable to keep both type 1 and type 2 error small at the same time? (You may assume that the company claims the new drug has 68% accuracy) [6]: # your…
- Write a function sum_and_print(nums) that takes a non-empty list of integers nums as a parameter and prints a series of partial sums in the format shown in the table below. The first line of output shows just the first number, the second shows the first number plus the second, the third shows the sum of the first three numbers, and so on. For example: Test Result sum_and_print([3, 1, 2, 0, 4]) Total up to i = 0: 3 Total up to i = 1: 4 Total up to i = 2: 6 Total up to i = 3: 6 Total up to i = 4: 10 sum_and_print( [333]) Total up to i = 0: 333A1 Write a function DifferenceSequence (Equation, Initial Conditions, Number Of Terms) which takes as inputs lists representing a ho- mogeneous linear difference equation, and some corresponding initial conditions, and an integer n representing a (large) num- ber of terms, and outputs a list of the first n terms of the solution: [0, 1,...,xn-1]. Hint: create a solution list which consists of the initial con- ditions. Set up a loop whose length is the number of terms you need to calculate. At each stage compute the new term by tak- ing the dot product of the coefficients and last few terms in the solution list, and then append it to the end of the solution list.Abraham Series to Compute Write a well-documented Python program, hmwk4Q2.py, that calculates. Construct a function abr_pi.py(N) accepts an integer N and returns an estimate of computing the Abraham Series using N terms. The series is: [2(1) 3ần 2n + 1 12=0 Have the main() call upon your function for various values of N to ensure it is correctly working. π =
- Once Brungilda has found the minimal number of boxes, she wanted to order the boxes but found out that she does not know what sizes to order. Complete the code below to produce a function num_boxes(n) that returns a pair: the minimal number of boxes and a list of the sizes of the boxes. For example, one possible correct value for num_boxes(10) is (3, [1, 1, 2]). import math def num_boxes(n): tbl = [math.inf] * (n + 1) tbl[0] = 0 last = [0] * (n + 1) for j inrange(1, n + 1): i = 1 while i**3 <= j: if tbl[j] > ???: tbl[j] = ??? last[j] = i i += 1 cubes = [] current = n while current > 0: cubes.append(???) current -= last[current]**??? return (tbl[-1], cubes) # should print (3, [1, 1, 2]) # the order of boxes might be different print(num_boxes(10))The following program reads two lines of input from the keyboard. The first line is a bicycle wheel circumference in centimetres. The second line consists of a number of times in milliseconds, separated by a comma, at which a fixed point on the bicycle wheel passes between the forks. The program computes the speed of the bicycle from each pair of times and prints a table of the results. Rewrite the program so that it behaves exactly the same but is pylint compliant, with the additional constraint that no function body can have more than 6 statements. (The function def line, blank lines and comments do not count as statements.) The only permitted global code (that is, code lines that are not indented) are the module docstring, function def lines and the call to your main function. All other code (assignment statements, if statements, loops etc) must be within function bodies. Note that docstrings are required for pylint compliance, but you do not need to make them meaningful.…Making a list of numbers from 2 to n Create a function named make-2-n-list that takes in one parameter, the end number. It should return a list of numbers from 2 to that number.(make-2-n-list 30) ➔(2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1718 19 20 21 22 23 24 25 26 27 28 29 30) Hint: make a function that makes the list backwards (easy right-fold pattern), then look at your recursive case and think backwards. Pls use scheme(R5RS) to finish this program!Thank you a lot!