can you please show me how exactly i should change the code in order for it to run?
Q: A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input,...
A: import java.util.Scanner; public class LabProgram{ public static void main(String[] args) { Sc...
Q: Add the numbers HA36 and BE36 in base 36, expressing your answer in the same form, i.e., in base 36 ...
A: In decimal In base 36 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 A 11 B ...
Q: What are two reasons why cables should be tied up and out of the way inside a computer case?
A: Introduction What are two reasons why cables should be tied up and out of the way inside a computer ...
Q: Example-3: Write a program to calculate the Area and volume for a sphere. Sol. -The area of sphere =...
A: code : int main(){ float radius; float surface_area, volume; printf("Enter radius of the ...
Q: With appropriate examples, explain the features of static class members.
A: In C++, a class's data members and member methods can be classified as static. A class can have both...
Q: Microcontroller (PIC16F877A) : If program will not reach that point write “unknown”. A = 0000 0000...
A: Here, I have to provide an explanation to the above question.
Q: 3 Proof Prove or disprove that the context-free languages are closed over the reverse operator, i.e....
A: We want to show that if L is a context-free language, then LR is a context-free language. So let G b...
Q: 1. What are the different scheduling algorithms? In your opinion, Which is the easiest to implement?...
A: Answer : Definition: A Scheduling Algorithm is the algorithm which tells us how much CPU time we can...
Q: Mention some poor examples of web design.
A: Introduction: Website design: Web design is a wide term that includes the variety of talents and dis...
Q: I am a doctoral student and I would like to know how to use this website
A: Lets see the solution in the next steps
Q: Q13. Convert the following hexadecimal number to its corresponding decimal representation: (4E8A8)16
A: Given To convert hexadecimal number (4E8A8)16 Decimal.
Q: Which of the following lines, when inserted into the proper event process, cancels the key pushed by...
A: Introduction: Explanation If a key is pressed within a control, then the “KeyPress” event will occ...
Q: The following table is in 1NF. Convert it to 2NF using proper notation:
A: Facilitator (FacilitatorID, LastName, FirstName, Street, City, ZipCode, (ForumNum, ForumDate, Custom...
Q: What would happen if a procedure ignored the RET instruction?
A: Intro the question is about What would happen if a procedure ignored the RET instruction? and here i...
Q: Differentiate between users of an organization's information system who are vertical and horizontal ...
A: Given: Differentiate between users of an organization's information system who are vertical and hori...
Q: You were asked to create a currency converter for a Forex Bureau. The customer desires an interactiv...
A: Introduction: Since here no programming language is specified. So, we are providing a solution in C...
Q: Explain............ Alex is setting up a new office. He wants the nodes in his office network to be...
A: Answer : Star Topology Star topology is a network topology in which each network component is...
Q: Q15. What is the first (rightmost) digit in the expansion base 6 of 82?
A: Ans: The first (rightmost) digit in the expansion base 6 of 82 is 4.
Q: Is the following array-based tree a min-heap or a max-heap or not a heap at all? 54 41 37 34 20 27 2...
A: Answer: As you can see, the root element in the provided array bases heap is always bigger than its ...
Q: r) Input a string s that contains lowercase alphabets. Then write a function that takes the string s...
A: INTRODUCTION: In this question, we need to input a string s which contains lowercase alphabets. We n...
Q: Consider the grammar below: S → aSb|bSa|SS|A For the string ab, how many leftmost derivations with 4...
A: Here, we are going to find out number of leftmost derivations with 4 or fewer steps for string ab.
Q: What distinguishes the FSTP instruction from the FST instruction?
A: Intro the above question is about What distinguishes the FSTP instruction from the FST instruction? ...
Q: sin'a 1) Let A = 1-cos and B = B for x = 0.1,0.01, 0.001, 0.0001,0.00001, and calculate the error fo...
A: 1) clc;clear all;close all;x=[0.1,0.01,0.001,0.0001,0.00001];A=(1-cos(x))./(x.*x);B=(sin(x).*sin(x))...
Q: The boxplot(data) function displays a graphical representation of the three-number summary of the da...
A: Actually, given question regarding boxplot function.
Q: Computer science Explain the types of Routing policies available in Amazon route S3. 63. Explain the...
A: Introduction: Amazon Route 53 is a highly accessible and scalable cloud Domain Name System (DNS) web...
Q: Why is it advantageous to block a tape? Because it requires less tape to store the same amount of da...
A: Because we know that it has additional benefits such as blocking, we may save a significant amount o...
Q: e a JAVA program to calculate percentage of a student for 3 different subjects. Create an exception ...
A: Solution:-
Q: 2.In the 'Table Area' below, create a table with three headings with the following order: Year, Tota...
A: MS excel is a worksheet that is used to store and analyze numerical data. It has functions that make...
Q: In a few words, describe the history of the development of wireless LAN technologies.
A: The answer of this question is as follows:
Q: What exactly is modular programming? Make a list of all the details regarding returning and non-retu...
A: Intro C-programming: It is a procedural programming language that can be used for developing several...
Q: Every two years, the volume of digital data is estimated to double, according to some estimates. Dis...
A: Introduction: The separate and discontinuous representation of information is referred to as digital...
Q: Describe how organizational culture is related to project management. What type of culture do you th...
A: Organisational culture is related to project management in many ways.
Q: In the HTTP protocol, what is the primary different between a GET request and a PUT request? GET req...
A: By using this HTTP -- Hyper Text Transfer Protocol user is able to communicate between client and se...
Q: Investigate and describe the potential for EPM (Enterprise Programme/Project management) – SAP – wh...
A: SAP's Enterprise Performance Management (EPM) solution. It is a set of SAP ERP platform features aim...
Q: :the output of (Print "a", "b", "c") is abc O ab c abc
A: With respect to your question answer is given below:- According to the question, this double quote...
Q: Write a java procedure that implements the more-efficient binary search algorithm a) test that x = “...
A: I give the code in Java along with output and code screenshot
Q: Consider the language L that is comprised of all strings with any number of b's. Which grammar liste...
A:
Q: In which register is the base position of a global descriptor table stored?
A: Introduction: the question is about In which register is the base position of a global descriptor ta...
Q: Consider the following subtraction operation assuming the values are in S2C form and select the corr...
A:
Q: Which of the following best describes a connection in which each occurrence of data in one entity is...
A: Intro Which of the following best describes a connection in which each occurrence of data in one ent...
Q: and provide answer. 1. Discuss briefly uses of pointer variables in various computer languages al...
A: Pointers are utilized to store and deal with the addresses of progressively distributed squares of m...
Q: Describe the downsides of the OSI Model.
A: Introduction :- The International Organization for Standardization (ISO) developed the open systems ...
Q: I'm not sure what you mean when you say "operating systems for resource-constrained devices." Explai...
A: Operating system is a system software which manages the computer software, hardware resources and th...
Q: Describe two processes that all queues must carry out.
A: Introduction: Queue operations might involve initializing or processing the queue, utilizing it, the...
Q: The following table is in 2NF. Convert it to 3NF using proper notation: Forum (ForumNum, ForumDate,...
A: Second normal form (2NF) is based on full functional dependency and the third normal form (3NF) is b...
Q: Hello, this is for python. Can you please include examples like; # Check to see if 2 names were sub...
A: For this program, we will be building a function for calculating tuples for dollars, quarters, nicke...
Q: Why is top-down data security superior than bottom-up data security?
A: Introduction: The top-down strategy has the benefit of allowing choices to be made and executed rapi...
Q: When a router receives an ARP request that is meant for a distant host, it can respond with which of...
A: Introduction: An ARP request is necessary when a device wants to determine the MAC address of anothe...
Q: Explain the System in detail. What is the class of data namespace?
A: Answer : system A system is a collection of elements or components that are organized for a common ...
Q: Write a VBA Function to count the words in a String. (Hint: use Split) Test this Function (should re...
A: Module VBModuleFunction wordCount(Text As String) As Integer Dim wordCnt = 0Dim String_Len As Intege...
can you please show me how exactly i should change the code in order for it to run?
Step by step
Solved in 2 steps with 1 images
- def 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?#include <stdio.h> int arrC[10] = {0}; int bSearch(int arr[], int l, int h, int key); int *joinArray(int arrA[], int arrB[]) { int j = 0; if ((arrB[0] + arrB[4]) % 5 == 0) { arrB[0] = 0; arrB[4] = 0; } for (int i = 0; i < 5; i++) { arrC[j++] = arrA[i]; if (arrB[i] == 0 || (bSearch(arrA, 0, 5, arrB[i]) != -1)) { continue; } else arrC[j++] = arrB[i]; } for (int i = 0; i < j; i++) { int temp; for (int k = i + 1; k < j; k++) { if (arrC[i] > arrC[k]) { temp = arrC[i]; arrC[i] = arrC[k]; arrC[k] = temp; } } } for (int i = 0; i < j; i++) { printf("%d ", arrC[i]); } return arrC; } int bSearch(int arr[], int l, int h, int key) { if (h >= l) { int mid = l + (h - l) / 2; if…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 ?
- #include <iostream> using namespace std; const int ROWS = 10; const int COLS = 10; int generateRND(int MIN, int MAX) { return rand() % (MAX - MIN + 1) + MIN; } void initializeArray(int C[][COLS], int min, int max) { for (size_t i = 0; i < ROWS; i++) { for (size_t j = 0; j < COLS; j++) { C[i][j] = generateRND(min, max); } } } void swap(int A[][COLS], int B[][COLS]) { int temp; for (size_t j = 0; j < COLS; j += 2) { for (size_t j = 0 ; j< COLS; j +=) } } void printArray(int C[][COLS]) { for (size_t i = 0; i < ROWS; i++) { for (size_t j = 0; j < COLS; j++) { cout << C[i][j] << " "; } cout << endl; } } int main() { srand((unsigned)time(0)); int A[ROWS][COLS] = { 0 }; int B[ROWS][COLS] = { 0 }; const int MIN = 2; const int MAX = 50; initializeArray(A, 2, 50); } Declares two 10X10 Two-dimensional arrays A and B of type integer. Each array consists of 100 random integers between 2 and 50. Swaps (exchange) the elements of odd rows of A…#include <iostream> using namespace std; const int ROWS = 10; const int COLS = 10; int generateRND(int MIN, int MAX) { return rand() % (MAX - MIN + 1) + MIN; } void initializeArray(int C[][COLS], int min, int max) { for (size_t i = 0; i < ROWS; i++) { for (size_t j = 0; j < COLS; j++) { C[i][j] = generateRND(min, max); } } } void swap(int A[][COLS], int B[][COLS]) { int temp; for (size_t j = 0; j < COLS; j += 2) { for (size_t j = 0 ; j< COLS; j +=) } } void printArray(int C[][COLS]) { for (size_t i = 0; i < ROWS; i++) { for (size_t j = 0; j < COLS; j++) { cout << C[i][j] << " "; } cout << endl; } } int main() { srand((unsigned)time(0)); int A[ROWS][COLS] = { 0 }; int B[ROWS][COLS] = { 0 }; const int MIN = 2; const int MAX = 50; initializeArray(A, 2, 50); } Declares two 10X10 Two-dimensional arrays A and B of type integer. Each array consists of 100 random integers between 2 and 50. 1. Swaps (exchange) the elements of A with…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)): 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”.
- Rooks on a rampage def safe_squares_rooks(n, rooks): A generalized n-by-n chessboard has been invaded by a parliament of rooks, each rook represented as a two-tuple (row, column) of the row and the column of the square that the rook is in. Since we are again computer programmers instead of chess players and other normal folks, our rows and columns are numbered from 0 to n - 1. A chess rook covers all squares that are in the same row or in the same column. Given the board size n and the list of rooks on that board, count the number of empty squares that are safe, that is, are not covered by any rook. To achieve this in reasonable time and memory, you should count separately how many rows and columns on the board are safe from any rook. Because permuting the rows and columns does not change the answer to this question, you can imagine all these safe rows and columns to have been permuted to form an empty rectangle at the top left corner of the board. The area of that safe rectangle is…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 loopusing namespace std; int main() int i, m=0,n=4; float arr[100] (55,66,88,1); for(i=0; iQ1 #include <stdio.h> int arrC[10] = {0}; int bSearch(int arr[], int l, int h, int key); int *joinArray(int arrA[], int arrB[]) { int j = 0; if ((arrB[0] + arrB[4]) % 5 == 0) { arrB[0] = 0; arrB[4] = 0; } for (int i = 0; i < 5; i++) { arrC[j++] = arrA[i]; if (arrB[i] == 0 || (bSearch(arrA, 0, 5, arrB[i]) != -1)) { continue; } else arrC[j++] = arrB[i]; } for (int i = 0; i < j; i++) { int temp; for (int k = i + 1; k < j; k++) { if (arrC[i] > arrC[k]) { temp = arrC[i]; arrC[i] = arrC[k]; arrC[k] = temp; } } } for (int i = 0; i < j; i++) { printf("%d ", arrC[i]); } return arrC; } int bSearch(int arr[], int l, int h, int key) { if (h >= l) { int mid = l + (h - l) / 2; if…# 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…def tnr(tn, fp): # TODO 11.1 return defTEST_tnr(): tnr_score = tnr(tn=100, fp=40) todo_check([ (np.isclose(tnr_score,0.714285, rtol=.01),"tnr_score is incorrect") ]) TEST_tnr() garbage_collect(['TEST_tnr'])SEE MORE QUESTIONS