Home
Ask directory
AP CS
February 2023
10
AP CS
Q&A Archive of
February 10, 2023
Select Question
February 10 of 2023
Assume that a newborn baby is a girl with probability p and a boy with probability 1 - p. Also assume that the genders of different newborns are independent of each other. Consider a person who has two children. Define the following two events: A ="both children are girls" B ="at least one of…
Write a C program that will allow two users to play a tic-tac-toe game. You should write the program such that two people can play the game without any special instructions (assume they know how to play the game). Prompt the first player (X) to enter their first move. Then draw the game board…
Explain-briefly the main ambiguity problem caused by the string matching problem. How to solve it?
Write a MATLAB code Task 1: Heart rate estimation from ECG signal An electrocardiograph (ECG) is a recording of the electrical activity of the heart. It can be used to detect several heart diseases and also to estimate the heart beat rate. Write a code that reads the ECG signal from a file…
Reference to the OutputStream named binobj. 6. Show 2 common constructors for the Label class. 7. What listener should be used with CheckBox?
Help 3.What method is used to tell if a RadioButton is selected? 4. What method is used to obtain text from a TextField called tf
NaeM 1.10 The implication (p > q) is equivalent to which of the following? a) p ∧ ¬q b) p ∨ ¬q c) p → q d) p ↔ q 2.10 Suppose that P(x, y, z) is a predicate where the universe for x, y, and z is {1, 2}. Also, suppose that the predicate is true in the following cases: P(1, 1, 1), P(1,…
cout << alpha[i] << ; 24. Given a 100-element, one-dimensional array beta, write a code fragment that could be used to print out the values of beta[0], beta[2], beta[4], and so forth (All variables are of type int.) 25. Given the declaration float alpha[75]; what is the valid index range of…
AME PROFESSIONAL ORTHOPAEDIC 8. fields An integer called invnum, a String called name, and a double called price handling.
EPP2 - Microsoft Visual Studio File pricelist - Notepad File Edit Format View Help 30430.99 Apple 740010.79 Coke Server Explorer 10078 3.29 Eggs 6ct 10079 6.00 Eggs 12ct 343022.49 Milk 1qt 59004 2.99 Bread wheat Toolbox
If a processor does not have a multiplier - it can multiple with help of true false - the program counter register false - dividers false - shifters true true true false - adding a series of shifted numbers
Access times are TLB=1, Cache=5, Main Memory=20, and MM miss ratio=0. True (False - if miss ratios are TLB=3/4, cache=3/4, the cache should not be used). True (False - if the miss ratios are TLB=4/5, cache=1/2, MM=0, the average access time is 12). True (False - if the miss ratio of the TLB=0,…
Inverters flip all bits in a register. Incrementers add 1 to a register. True False - If the output of an inverter was fed into another inverter, the overall output would be the input. True False - Inverters have a latency of 1 NOT gate. True False - An incrementer has the same latency as an…
A line of Java - if (C > 0) true false - requires a jump zero instruction false - uses the shifter true true false - requires a jump negative instruction false - compiles into many assembly instructions true
Fall 2018 Executing INT instructions, 190 s executed L/S instructions, and 20 s spent executing branch instructions. For all the other instruction classes remains unchanged? By how much is the time for L/S instructions reduced if the total time is reduced by 30% and the timings for all the…
In a Shuffle Exchange network true false - a 30 node network would need 5 stages false - the data does not travel along a bus false - a 10 node network would need 3 stages false - the nodes not are Fully Connected true true true
Hi, how are you? I need an answer plus a full explanation for this question. Please give a table as well. Many thanks. Problem 6 - Fill the table with IF, ID, EX, MEM, or WB, or space if delayed. Assume a pipelined RISC-V machine with no forwarding. Assume also that we can read and write any…
The expression 2 is equal to expression 1 or expression 2 multiplied by b-op2 and expression 1. The value of b-op2 is 1. Expression 1 is equal to expression 0 minus expression 1. The expression 0 is a constant variable. The expression 3 is the root of the uv trees and abstract syntax trees. The…
In cursive is written, "Don't use the find function." Question 2: Write a MATLAB function called my_fun that takes a vector of numeric values, nums, as input and returns a vector containing only the indices of nums whose values are non-zero. You are not allowed to use any built-in MATLAB…
Could I get a description of what you are doing in each line of code? I'm quite new to programming and need to write a report. This is done in MATLAB. Problem 1 [15 Marks] Write a script to evaluate the following piecewise linear function: a) Ask the user to input x values (using the input…
Write the void function named PrintMin that accepts a pair of integers and prints out the smaller of the two.
COSC241 Fall 2018 7. For the following BST, show the result of the order traversal: 27 1 20 11 12 / 17 7 / 29 7 Vinal. Exam 5 pts Answer: 8. Please convert the following infix expression to its corresponding postfix expression: s+c*b+d <5 pts> The equivalent postfix expression is Draw the BST…
QUESTION1 Which of the following best fits the definition of independent and identically distributed in machine learning? O There is a high probability the that model will work well on new data arriving after the model has been trained and tested. O Data which arrives after your model has been…
All other hashing methods create collisions. h. Linked List. Buckets.
The answer to Q2 is always contained in the answer to Q1. (dQ1 and Q2 produce different answers. Problem 5 (4 points): Relation Ra, b, c currently has the following instance: {1, 2, 3, 3, 4, 2, 2, 6, 1}. We make the following view definitions: CREATE VIEW AS SELECT ab AS d, c FROM R; CREATE…
Extra Credit (+5 Points): In programming assignment #4, you were tasked to implement a significant number of linked list functions. Similar to assignment #4, assume a linked list of students has been allocated on the heap. Write an additional function called cleanUp. This function should…
Text: Question #17: Assembly Language Function (10 points): Write a MIPS assembly language function that determines the maximum of two integers. For instance, if the user types in 5 and 10, the code below should print 10. If the user types in 45 and 30, the code should print 45. Make sure to…
Write the C++ code to: A. Create a node structure B. Allocate memory for a new node C. Initialize the contents of the node D. Set the pointers to NULL 10 points
Questions related to JavaFX 6. Name an advantage of using a Slider in place of a ScrollBar. 7. Can a Graphical User Interface, such as programs using JavaFX, use System.out.printO? If so, why would a GUI use System.out.printO? 8. What are the benefits of using a Slider in place of having a…
Please give me an example or draw some pictures to help me understand how it works. Let AecFG = {(G) | G is a CFG that generates ε}. Show that AecFG is decidable.
Create a valid HTML5 document that has a paragraph about any server-side technology of your choice. [10 points added to assignment]
RAID advisor, course department. Disakey/ID advisor together are a key ID course together are a key. Write this query in relational algebra. Write this query in SQL. Department other than their own. Write this query in relational algebra. Write this query in SQL.
Problem 8: 20 points Consider the following relational database schema: Student(ID, name, dept, status) // status = grad or undergrad* // ID is a key RA(ID, advisor, dept) // ID, advisor together are a key TA(ID, course, dept) // (ID, course) together are a key (a) Write this query in…
b) (4 points) Write an SQL request that, for each address, finds the total repaid amount for the address.
The following are executed: by A: GRANT UPDATE ON R TO B by A: GRANT UPDATE ON R TO C WITH GRANT OPTION by C: GRANT UPDATE ON R TO B WITH GRANT OPTION by A: REVOKE UPDATE ON R FROM C CASCADE Which of the following best describes the status of B's privileges on R? (a) B can update any attribute…
Please answer 18; it is very important. If you can answer the rest (15, 16, 17), I will appreciate your help. Thanks a lot. 16. Can a constructor be overloaded? Why? Inside the main function below the BankAccount class: private: string AccountNumber; string FullName; public: …
Assembly Language for x86 Processors. 9. Given a WORD, how would you load it into EBX register?
Assembly Language for x86 Processors. 7. How would you load the address of an array called arr into the EAX register?
Trying to find an answer for b. SaAB 99 = 99896 999. b. Describe the language generated by the grammar in part a using a formula.
Assembly Language for x86 Processors
After you execute the cmp instruction, how do you know the result? Explain the states of the relevant flags.
C++ and implementation file (Course.cpp). The class contains a dependency on a Section structure, which should have the following interface: struct Section { string section_code; // Section Code string days[2]; // Array of days section meets per week string times[2]; // Array of…
Example 1: sw $t2, 4($t0) lw $t2, 8($t0) sub $t4, $t2, $t3 add $t5, $t2, $t4 lw $t6, 0($t5) sw $t6, 4($t5)
Problem 1 - Page Replacement Strategies: In a virtual memory system implemented by paging, when a page fault occurs, we must bring in a new page. However, usually the operating system must choose a victim page to be removed from memory to make room for the newly-referenced page. a. Give at…
How do you convert a char to int and vice versa? In C++. My professor gave me this, but I don't understand it. Converting a char to int: char ch = 'x'; int x = ch - '0'; Converting an int to char: int in = 6; char ch = in + '0';
Help with an Algorithm Question 4. RSA, Primality Testing, and Factoring (a) Show that a = 2 is not a witness to the compositeness of p = 13. (b) Suppose a particular implementation of the Pollard rho algorithm factors a 100-bit RSA modulus in one minute. Use the running time heuristic to…
Assuming your student ID number is of the form "xxxxxxxAB", you will consider the values A and B in the sequel. For the questions you need to give numerical analysis, in other words, you need to try your implementations for different values and compare the results. Write a MATLAB…
Detailed inference steps. INITIALIZE-SINGLE-SOURCE(G, s) 1. for each vertex v in G.V 2. c = ∞ 3. v.Ï€ = NIL 4. v.d = 0 RELAX(u, v, w) 1. if v.d > u.d + w(u, v) 2. v.d = u.d + w(u, v) 3. v.Ï€ = u DIJKSTRA(G, w, s) 1. INITIALIZE-SINGLE-SOURCE(G, s) 2. S = ∅ 3. while Q ≠∅ 4. u =…
Text: expected output, including the table b and c. Input: X=GSTSAQBY=AGGTAB LCS-LENGTH(X,Y) 1 m=X.length 2 n=Y.length 3 let b[1..m,1..n] and c[0..m,0..n] be new tables 4 for i=1 to m 5 c[i,0] = 0 6 for j=0 to n 7 c[0,j] =…
MORDE-TREE-WALK(x) HIL 2 INORDER-TREE-WALK(x.left) PRINT x.key INORDER-TREE-WALK(x.right) Pseudocode: 1. The input tree 2.25 points Binary Search Tree a 5 points What property should a binary tree satisfy in order to be a binary search tree? b 15 points Given the pseudocode of Inorder…
Given the code below: #include <iostream> using namespace std; A) Complete the following linked list. B) Place m, x, and y as done in class, on the RAM below: RAM int main() { Byte0 Bytel Byte2 Byte3 int m = 20; int *x; int *y; x = &m; y = &m; …
EMT 2320 Degrees Apart: How many degrees will the rotor turn per step? 5 points 5. For the following Boolean equation (12 points total a, b, c): X = A + BA + CB + DAC + ABCD a) Write out the logic for the unsimplified equation. b) Simplify the equation. c) Write out the ladder logic for the…
Group C: [24 pts] Sorting algorithm 5 - Use ALEXSTOP to demonstrate how the quicksort algorithm works step by step. Please also use a stack to illustrate how the recursion of quicksort works. (12 pts) Program Dijkstra's 3-way partition algorithm in C++. And briefly explain the time complexity…
Group A: [27 pts] Assume that Alex is in charge of all 20,000 (N = 20,000) Fresno State students' academic consultation. He can only take care of up to 10 (M = 10) students per day, and let's assume the lowest GPA students have the highest priority. Based on what you've learned this semester,…
Using #include <iostream> using namespace std; int main() { int a = 4; cout << "Hello, World!" << endl; return 0; }
a. SDWORD myList 500 DUP (1) b. myList SDWORD 500 DUP(1) c. myList SDWORD 500 DUP(1) d. myList SDWORD 500 DUP(1) 29. The following are both valid data definition statements: a. List1 BYTE 10,20 b. BYTE 30,40 a. True b. False 30. The basic parts of an instruction, in order from left to…
4.20 Given the following directed graph, list the vertices which will be visited from A to F (use left to right search sequence): a. Breadth First Search: b. Depth First Search: ADJACENCY MATRIX: DESTINATION SOURCE 9EE CONNECTIVITY MATRIX: DESTINATION SOURCE A8E A 5.30…
Things You Can't Do Exercise: Explain what's wrong with the statements in the following function that are in colour: int * fn ( int ** n ){ int j = 7, k = 5; *n = &j; return &k; 1
Intelij Idea - Please "Java
In IntelliJ IDEA, please select "Java".
Consider a set of concurrent processes Pk that model the students entering a classroom to attend lectures. Due to energy constraints, it is required that lights in the classroom are only turned on when the first student enters and turned off when the last student leaves. The pseudo-code…
Using one-dimensional arrays, solve the following problem: a company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson that grosses $5000 in sales for a week receives 200 + 9% of $5000 for a…
I need help solving a given Python problem. Please use the function that is required for coding. Problem: A straight line can be defined by a pair of points p:(x, y) and p2(x, yz). The slope m of a line is defined as follows: m = (y2 - y1) / (x2 - x1). Your program reads the points from a…
Please help. Thank you. 8. Address Resolution Protocol is used for the translation of MAC addresses to IP addresses. 8.2. IP addresses are addressed to MAC addresses. 8.3. TCP addresses are translated to MAC addresses. 8.4. TCP addresses are translated to IP…
Please show me an example to help me understand how it works. Give implementation-level descriptions of Turing machines that decide the following languages over the alphabet {0,1}: b.Kw| w contains twice as many 0s as 1s.
The string Samuel, the row will not be found. 25 - True - False. An SQL identifier, such as a table name, can be no longer than 64 characters. 26 - True - False: COUNT, SUM, and AVG apply to both numeric and nonnumeric fields. 27 - True - False. The referential action CASCADE allows deleting a…
Subject: You are a network administrator in NASR company. This company has around 5000 employees distributed in 5 branches. It also has around 600 PCs, a web server, a file server, and around 50 printers. The employees may need access to the local web and/or FTP servers, and they can also…
Before A: An example is shown below: 3 Question 2: (6+9) points 1 2 3 5 2 0 8 The function has to be general for any 2D array of any size. 193 Note: Assume that M is defined as a constant outside the function definition. Don't use scanf and/or printf in the function definition. Assume that…
JS events - what are they, how do you use them, what are some examples? JS OOP - how do you define a class? Methods? Instantiate a class? JS Closures - what are they? How are they used?
Write Java code according to the comments. Total 14 points. public static void main(String[] args) { } //end main public static void show(String s, int n) { System.out.println("COMP2243 " + n); } public static double calculate(int x, String s, double y) { return x +…
Text: list BIVAALE. Then count(list) will return 4, 5, 10, 15, 6, 3043, 9, 608, 80, 12pt AT Paragraph 4 X. Write a method called count that counts the number of single-digit values in an array of integer values. For example: iii ii words.
For the weighted graph given below, use the algorithm discussed in steps 1 and 2 to redraw the graph along with the indices and candidate class to find the shortest path from a to z. Be sure to show all of your shortest paths each time that the nodes are reindexed.
BIVAA Question 6: public static int count(String str, char ch) method using the following header: 12pt 4 MII Paragraph 9 (Occurrences of a specified character). Write a method that finds the number of occurrences of a specified character in the input string.
Text: Need help with question 9 9. Here is a brief program that creates a couple of arrays and puts Warthogs (see previous question) on them. Draw a picture of the contents of memory (the two array lists and the warthog objects with their instance variable values) at the point in the program…
Here is a simple little class that tests if a number is even or not. Write a Junit test class that tests the isEven method. Be sure to test all cases. public class NumberFun { public static boolean isEven(int n) { return n % 2 == 0; } }
The text provided below shows the message-passing primitives used in the operating system. Each process (Pi=1,2,N) has a section where it can request permission to enter the critical section (CS). The cs_mgr process is responsible for granting permission to the requesting processes and managing…
A graph is given by the adjacency matrix. Give a pictorial representation for the graph and draw the data structure (as discussed in class) for adjacency list representation for this graph. 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0
(5 points) Based on the graph and your answer above, please design a Turing machine that 0.
QUESTION 3 A group of people has n men and n women. In how many ways can a line be created such that men and women alternate? 0(2n) 0 2(n!) 0 2(n!2)
A binary search tree is to be built using the algorithm given in class. The following numbers are input in the order given: 30, 50, 15, 60, 40, 10, 20, 70, 55, 45, 47, 46, 56, 59, and 57. Draw the resulting tree.
Select the true statements. J7n+1 The coefficient of xy in the expansion of (x + y)^17 is The coefficient of xy in the expansion of (x + y)^17
Please enter your name here: 40 20 + 20 20/30 1 P = R P = 24.50 P = 11.5aW
QUESTION 8 0 263 (26) (23) 0 26! 3! 0 26! 23!
PLEASE DO 5 ITERATIONS OF EULER METHOD W/ H=0.1 USE EXCEL TO PLOT THIS SYSTEM OF EQUATIONS AND USE THE EULER METHOD TO SOLVE FOR CONVERGENCE, SHOW EQUATIONS USED IN CELLS Lotka-Volterra Population Model Given the following predator-prey relationship: Y1' = -0.1y1 + 0.02y1Y2 (predator) Y2'…
For the weighted graph given below, use the algorithm discussed in class to find the shortest path from a to z. Be sure to show all of your steps and to redraw the graph along with the indices and candidate shortest paths each time that the nodes are…
Algorithm given in class, redraw the array each time that an entry changes. You may redraw only once for each swap. Be sure to indicate which elements are being swapped.
Prove by mathematical induction that T(n) = n^2 is the solution to the recurrence relation T(0) = 0 and T(n) = 2n + T(n-1).
To support the collaboration between UPS and Pizza Sop, suggest a simple but meaningful and persuasive web architecture. Pizza Company UPS Driver UPS Maintain the vehicle (repairs, servicing) BIRCH UPS Technology is used to manage deliveries (GPS)
Text: MATLAB Problem 6 (a) Write a function that takes three input arguments (numbers) x, y, z and then returns the average of the three numbers. (b) Write a program that: (1) Solicits from the user three values, (2) Calls the function that you wrote above for part (a) to compute the average,…
Question 5: One of the following sets is c.e. and the other is not. 1. {M: |L(M)| = 330}, 2. {M: |L(M)| = 330} where M is a Turing machine description, L(M) represents the language recognized by M, and |L(M)| denotes the size of this language. Identify which set is c.e. and which is not, and…
accepting states. 3. Convert the NFA to a DFA. Show the transition table. Clearly mark al
Given the array int test = {1, 2, 3, 4, 5, 6}: a) Write the loop without pointers to print out: 1 2 3 4 5 6. b) Using pointers, print out the same output using * notation. c) Write the output for the following program: #include <iostream> using namespace std; int main() { int r = 5, *q =…
What is multithreading? Comp sci question homework. (c) (3 points) What does the keyword synchronized mean in the context of Multithreading? (d) (5 points) Explain the top 4 benefits of using multithreading. Clearly, all four benefits are targeted towards a particular initiative. What is that…
Text: Basic Comp sci questions closure & Nash homework 12. (4 points) Fill in the blanks below. a) 11 b) 8 c) We discussed in class. We looked at two different solutions to solve this problem. Let us suppose you are using shallow binding, what is the output value that gets printed by the…
In Prolog, define a predicate sagranny(X, Z) that checks if X is a grandmother of Z and a predicate hasSibling(X) that checks if X has a sibling. Also, define several facts and include them before your predicate definitions, such that querying your defined predicates would produce at least one…
Let p = 3 mod 4 be a prime number. Show that x ≡ -1 mod p has no solutions. Hint: Suppose such an r exists. Raise both sides of the equation to the power p-1 and use Fermat's theorem.
Text: Memory address questions homework 3.9 points each Given the following declaration, assume a[0][0] is at location 5001 char array[][] = new char[7][9]; a) (3 points) At what memory address is array[5][7] located if row-major ordering is used? (A char requires 1 byte.) b) (3 points) Same…
ANSWER QUESTION 3 Consider the problem of factoring - decomposing a number N into its composite factors (e.g., 2881 = 67 * 43). This is generally understood to be a hard problem (in that the difficulty increases rapidly with N). For some N, however, factoring can actually be quite…
I need help with this, please. This is an incomplete Java program for BMI (Body Mass Index) calculation. Fill out the statements in the blanks with the following: 1. Enter your Height in inches: 2. int wt, ht // weight & height of a person in metric units 3. float b; // BMI value 4.…
Hello there! The following is an Artificial Intelligence question. Need serious help, please! Consider the search problem below with start state 'S' and goal state 'G'. The transition costs are next to the edges, and the heuristic values are next to the states. a) What is the Search Cost and…
Combine these two statements into one GUI statement to get the integer value from user input: String tStr = JOptionPane.showInputDialog("Enter an integer value"); int t = Integer.parseInt(tStr); What is the output produced by the following code: double iR = -0.05; double ip = iR * 100; double…
Please help me with these with explanations. I am confused about the concept and 0xD000000000000000, respectively 2.10.1 [5]<52.4> What is the value of 30 for the following assembly code? add x30.5, x6 2.10.2 [5]<52.4> Is the result in 30 the desired result, or has there been overflow? 2.10.3…
Please I need help with 11, 12, and 13. 11 ANS: double ANS: Line1) Line(2) ANS: double eB double bB iP double iR Line(1) = 2000 = iR * 100 = 0.05; What is the O/P produced by the following code: int t = Integer.parseInt(tStr); = bB * 1 + iR) --- statements that do the processing are here ---…
Text: Java 1. In the following code, the marked lines contain errors. For each part, answer the question about the error. (25 points) Part 1: What is the error at line a? interface A { void mi } class B implements A { void m1() { // System.out.println=i); } } Part 2:…
Please help me to write program 2 and 3. Exercises: Program 1: Program 8.2 in Chapter 8, pp. 167 of the textbook can determine tomorrow's date. Please rewrite program 8.2 with pointers to structures. Program 2: Write a program to construct a dictionary. Refer to program 9.9 on pp. 219 of the…
The round-trip time. The problem? (ii) RTT might exhibit high variance. (e) In the context of TCP, (iv) Describe how the timeout value is computed. Explain why the Round Trip Time. (ii) Compare the simple average and the exponential average methods for estimating.
1. Answer to a int doIt{} 2. integer x = 3.0; 3. class MyClass { 4. Answer to e 5. Answer to d 6. Answer to bc MyClass boolean b { 7. b = b; 8. } 9. 5 - 4 - (3 - 1) and average sect
Write a Java program that implements the following diagram: a. Create the Superclass Shape b. Create the Subclass Rectangle c. Create the Subclass Triangle Shape: - getArea(): double - toString(): String - getColor(): String Rectangle: - length: int - width: int - getArea(): double -…
In the network connection shown in Figure Q3, a web server is hosted by Computer C and an FTP server is hosted by Computer D. Computer A and Computer B are connected via an Ethernet switch. IP: 149.152.130.99 MAC: 22:44:11:BB:AA:FF IP: 158.145.205.160 MAC: 33:22:88:CC:AA:DD IP: 192.168.0.1…
Problem 5 - Consider a program consisting of 100 1D instructions in which each instruction is dependent on the instruction immediately preceding it, e.g., 1D x2,0(x1) 1D x3,0(x2) 1D x4,0(x3). What would the average CPI be in the pipelined processor with forwarding?
Problem 3 - Consider the following 16-bit floating-point number system in which we use 1 bit for the sign, 5 bits for the exponent, and 10 bits for the significand (mantissa). The exponent bias is equal to 16, and the largest and smallest biased exponents are reserved (similar to IEEE 754…
Explain how the IP packet described would be fragmented. 15 marks connected through the Ethernet transmission link and the second network has an MTU of network segments before it reaches its destination. The first intermediate network is An IP packet of size 8500 bytes with a header size of 20…
Please disregard the answers. They are not correct. Please answer correctly 17-21. 17. What is TRUE: 1) Hard real-time tasks must be executed exactly at specified time moments. 2) Soft real-time tasks never have deadlines. 3) Hard real-time tasks are not always periodic tasks. 4) Round-robin…
Watch the TED Talk: How to Find the Work You Love by Scott Dinsmore and complete the worksheet. View the TED Talk and complete the following grid. If you run out of space on the grid for any of your answers, feel free to continue writing on the back of this sheet. Title of TED Talk: Name of…
C++ 4. Complete Binary Tree implemented as an array. Insert elements (i.e. build the tree) - write the C++ code for a binary search (you have an ordered array) - Binary Search Tree (see slides), how to create, add, and delete items. For example, given values, create a binary search tree, add a…
Please disregard the answers. They are not correct. Please answer correctly. 1-6 We call this process management method: 1) Preemptive; 2) Nonpreemptive; 3) Interactive; 4) Non-scheduled; 5) Real-time. 2. Real physical address appears in the program: 1) After a programmer finishes writing a…
Problem #9: Modify an Euler Method code that finds the solution of the differential equation given below: With the initial condition of y0 = 3 at x0 = 2. Use the range of x from x = 2 to x = 3 and a step size of 0.1 to compute the value of y using the Euler Method C function created. Do the…
Problem #8: Develop a C code to integrate the definite integral I = ∫ using the Trapezoidal Rule and the Simpson's Rule with both 10 and 20 intervals. Develop the C-function for the Trapezoidal Rule and bring the computed numerical integral value to the main function before printing the…
Problem #7: Develop a C code with a C-function for Gaussian Elimination Method to solve the equations given below: Show the following output: - Print the code Title - Print with words the Given Left Hand Coefficient Matrix [A] of the given equation [A]{x}={B}, where x is the unknown vector…
Problem #6: The following table gives the percentage of acetic acid ionized (P) at different concentrations (C) in moles per liter. Develop a C program code to obtain the least model equation Phat(c) = b0 + b1 * c. C | P 0.10 | 1.35 0.05 | 1.91 0.02 | 2.99 0.0098 | 4.22 0.0059 |…
Problem #4: Develop a C code to calculate the average, median, and standard deviation using 5 numbers as data input from the keyboard. Compare the program output with the hand calculations shown with formulas for average, median, and standard deviation. Use the suggested approach below for…
For this assignment, you are to implement the String class, the specification of which is shown below. Using this String class, you are then to implement an application to sort a sequence of words input by the user. This application should begin by asking the user how many words, not to exceed…
Can anyone write this code in assembly language? Please and thank you. #include <bits/stdc++.h> using namespace std; int main() { int n; cout << "Enter the number of players: "; cin >> n; string b[n]; int a[n]; for(int i = 0; i < n; i++) { //initialize all the…
Most of the code is there already. I just need to know what "a=", what "b=" and what the last "C=". In Python please. Write a function named centroid_init(Z, K) that takes as input a data numpy array Z and the number K of clusters to group the data into, and returns as output a numpy array C…
Write a Python class to represent a Course. The course has an ID, Name, and a score in 5 tests. The score for each test is out of 100. # Code to test the Course class SE320 = Course() s1.scores.append(82) s1.scores.append(85) s1.scores.append(68) s1.scores.append(71) print(s1.percentage())
Scammelse hport refers to a Scanner object called stdin. LassEranfoleK. You may assume you are in a main method in a properly-defined class and that you have a Hretthie nd ifeger.
TaxApp Create an associative array with 5 elements to hold the Name, Gross Income, and Tax Status (i.e. Single, Married) of a Person. Use a Person class to store the Name, Income, Tax Status, Tax Rate, Net Income, and Gross Income. Iterate through each array to create instances of the Person…
The statements card1 = "hi mom" card2 = 3 card3 = Card() my_card = card3 card2 = card1 card1 = Card() will cause how many Card objects to be instantiated? (only one correct choice): 1 2 none 4 5
Using the diagram above, we have to write a SQL query for question 1 letters A and B. From my understanding, 'Swing' is a CD title. CDlibrary V5.0 GROUP-CD GROUP *grpid grpname PERSON-GROUP employee) PERSON *psnid psntname psniname PERSON-COMPOSITION "psncomprole psncomporder PERSON-CD…
Problem 1: Timestable Charts using C++ Program Since you obviously need to start planning for kids at your age, let's write a simple program you can use to print off timestable charts when your future children need to learn multiplication. Create a well-laid-out chart. It should not allow the…
Given the following table of processes: Process Arrival Burst CPU time A 0 3 B 1 1 C 2 4 D 3 2 E 4 3 Apply the RR algorithm for scheduling them with q=2
Here you can achieve with these drives if you use NRAIDS (c)RAID1S (RAID10). Draw the RAID configurations you propose. (6 points)
A single table is used for frames. Calculate the minimum and maximum memory required for keeping the page tables if: 1. A system that is using paging has 50-bit physical addresses, 64-bit logical addresses, and 16kB split between the two levels. 2. A two-level hierarchy of tables is used. You…
i kB. Show all the calculations. g = 7. Offset = 109. eg = 3. Offset = 100. Seg = 9. Offset = 0. Segment Table Base Address [Length 118872, 1, 905, 89596, 2, 342, 61527, 3, 1494, 559, 481, 4, 95544, 5, 28, 68253, 6, 768, 96757, 1249, 36191, 390, 19886, 6, 2, 30571, 536, 10, 111414, 931. Page…
Image processing software, such as satellite image processing software, is made up of two types of threads: feed threads that communicate with the satellite and fetch the image data, and processing threads that process the images and store them on hard drives. A crucial component in this…
[10 marks] Write HTML and JavaScript code for a complete web page that draws a yellow filled rectangle on a red background on an HTML canvas. The canvas should be 800 pixels wide x 400 pixels high; the rectangle should be 100 pixels high x 50 pixels wide, positioned on the lower left of the…
I need the flow graph/table drawn for this, demonstrating how the below (presumed correct) outputs were derived. Exceptional control flow. Consider the following C program. (For space reasons, we are not checking error return codes, so assume that all functions return normally.) int main() { …
Please write in assembly x86 #include<iostream> #include<bits/stdc++.h> using namespace std; int main() { int n, m, p, q = 0; cout << "Welcome to the game" << endl; cout << "Enter the number of players: "; cin >> n; int a[n]; string b[n]; for(int i = 0; i < n; i++)…
10. Assume Write lines of code that will accomplish each of these three tasks. Circles are TNodes, use left and right to refer to the children. Squares are TNode *refer to them based on their labels (root or cuz). When nodes are removed, make sure to not leave any orphaned memory (14…
A company makes products A and B from 2 resources, labor and material. The company wants to determine the selling price which will maximize profits. A unit of A costs $30 to make and demand is estimated to be 50 - 0.09 * Price of A. A unit of B costs $20 to make and demand is estimated to be 30…
Short answer please without Explanation What is the first program to execute when a Desktop computer is powered on, and what is its purpose?
Mat 172-ZH81-Pre-Calculus [Extra Credit] Please solve this maze and write down the process it took for you to do it in words.
A class can implement more than one interface type. In Java, a subclass has no access to the public instance variables of the superclass. T public. All methods in an interface must be explicitly declared as private or all methods in the interface are automatically public. T Extreme Programming…
Java Recreate the screenshot below. For reference, the frame is 300 x 300 pixels. The number display is in a different panel than the number buttons (along with the "C" and "." buttons). I have provided the initial setup, along with the numberDisplay JLabel. You must provide the…
Hi, could you help me with these three short questions please? 4. An array can be (Select all that apply): a) created with new, b) of a primitive type, c) of a class type, d) declared but not created, e) of length 10,000. 5. A class method can (Select all that apply): a) return a boolean, b)…
V Letter Pair Frequencies def letter_pair_freqs(words): Given a list of words guaranteed to consist of lowercase English letters a to z, only count how many times each one of the 26*26 possible pairs of letters occurs inside these words. Return the answer as a Python dictionary that maps…
1. What is the memory address (cell number) of the last instruction that would be executed? 2. When the program starts executing, what value will be stored in register 2? 3. When the program stops executing, what value would be stored in memory cell 54? For Questions #11-13, please refer to…
Quick Exercise C14a-3 Find out IPv4 addresses of the following hosts and indicate the class to which the IP addresses belong: 1. www.sci.brooklyn.cuny.edu 2. www.drsr.sk 3. www.google.com Remark: There are many ways to find out the IP address of a host given a domain name. For example, you…
d) four c) three b) two a) one X = z; B2 = X + 1 N B1: wait T; int Z; Process B signal T; A2: X = Y; A1: Y = X * 2; int Y; Process A T is set to 0 before either process begins execution and, as before, X is set to 5. 8. The program follows to use a shared binary semaphore T: Now, how many…
I need an explanation of the answer. d) 12 L (5 b) 2 a) 42 (GATE 1987) 5. At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operation.
Consider the following program fragment: addi $s6, $s3, 1 ape $t1, $ti, $s6 lw $s6, 0($t1) sw $s6, 0($t1) beq $t1, $t2, L ape $s6, $t2, $t2 L: apd $t3, $t1, $s6 In a previous homework, you identified all data and control hazards assuming an infinite stage pipeline. Repeat the problem, but…
For the given virtual addresses, indicate the TLB entry accessed and the physical address. Indicate whether the TLB misses and whether a page fault occurs. If there is a page fault, enter for PPN and leave part C blank. Virtual address: 2F09 Virtual address format: one bit per box 15 14 13 12…
Consider an allocator that uses an explicit free list. Each memory block, either allocated or free, has a size that is a multiple of sixteen bytes, and each payload must be aligned on a 16-byte boundary. The format of the header/footer is as in your malloc lab (low bit indicates whether the…
Possible words in Hangman def possible_words(words, pattern): Given a list of possible words and a pattern string that is guaranteed to contain only lowercase English letters a to z and asterisk characters *, create and return a list of words that match the pattern in the sense of the game of…
Q9: Write a function called downOdds that forms a new number from a non-negative integer parameter by decreasing all odd digits. In case a negative parameter is given, an answer of 0 is to be returned. For example, a program that uses the function downOdds follows: int main() { cout <<…
3y)[~Ky(x)Fyx Kx)] ~(y)FyY Add Line ->Begin Subproof
def riffle(items): Given a list of items that is guaranteed to contain an even number of elements (note that the integer zero is an even number), create and return a list produced by performing a perfect riffle to the items. When performing a perfect riffle, also known as the Faro shuffle,…
We have the following information about the students in one of ME 2800 sections: 1. There are 30 students in this section. 2. 6 students are either freshmen or sophomores. 3. The number of senior students is twice the number of junior ones. 4. There are 3 more junior students than sophomore…
Write a working C program that will calculate the total capacitance, electrical charge, and rms voltage drops across the set of two capacitors in series when connected to a 12V AC supply as shown below: C1 ---- A ---- I ---- B ---- I2 | | Vc1 Vca …
Text: C++ Programming Language 27. Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, write a complete program that uses a for loop to print a single line consisting of n asterisks. Thus, if n…
Exercise A EK = -74 mV ENa = +58 mV E = -47 mV K = 36 mS/cm^2 Na = 120 mS/cm^2 9L = 0.3 mS/cm^2 Cm = 1.0 F/cm^2 t = 0.05 ms Table 1: Standard parameter values for the Hodgkin-Huxley model. Use the finite difference method and the standard parameter values in Table 1 (above) to compute the state…
Suppose that we have six C functions that together solve some problem. Suppose these functions depend on each other according to the following dependency graph. Write a sketch of a C program that uses Pthreads to execute the above six functions in a way that is maximally parallel but adheres to…
Determine several ways to analyze. You should have several different charts and graphs and use functions and formulas, what-if analysis, pivot tables and charts, trendlines, etc. Use solver and scenarios and create macros. Put your charts, etc. on separate sheets and be sure to label…
Java TYM shing>entry NYIT YM NEW YORK INSTITUTE OF TECHNOLOGY Question 3B (15 points): Write into LinkedList structure by READING MONTH NAMES FROM the above HashMap and write into this new LinkedList (assume AddNodeToStart/End methods in StringLinkedList already exist)
Write a MATLAB function which takes coordinates of 3 vertices of a triangle as inputs and then calculates and returns its perimeter as the output. For the function name and input/output arguments, use: Perimeter = tri_perimeter(PA, PB, PC) The function should be able to handle…
Java CSCI185 FIM NYIT NEW YORK INSTITUTE OF TECHNOLOGY Question 2) (25 points) Task 1: Print numbers on the screen 1 to 99 Task 3: Print numbers on the screen 100 to 200 (executes upon condition) Task 2: Print character W on the screen 150 times Task 3 is started to execute only when Task…
Text: Database Name: Part 2 - SQL (20 points) For each of the following numbered tasks, provide the SQL statements and the results. Use appropriate data types and data shown in the sample database. Tables: Title (titleCode, titleDescription, salary) Department (deptCode, deptName,…
Q2: Can a file pointer be void? Yes/no, explain.
5[101520252830 yalue 96 is inserted into the B+ tree. node is approximately 200. Calculate average fan-out and height of the B+ tree. a node takes 12 bytes and the size of a pointer in a node is 8 bytes. Let us assume we have total b Let us assume that a node of a B+ tree is implemented as a…
Q1: Explain the following terms in detail with examples: a) Object b) Member function c) Constructor d) Destructor
Q2: Can a file pointer be void? Yes/no explain. Q3: A) Write a program in C++ which accepts the radius of a circle from the user, calculates its area, and displays the result.
2. Trace the quick sort algo on the following array and show the recursion tree. Use the first item as the pivot when doing a split 24.6.72.28.12.9.3
3. Consider the following figure in wireless networks. A communicates with B, and B communicates with C. What could be a problem in such communication? How to solve it (Please draw a figure to explain the solution?(5 pts) Node A sees Node B Node Csees Node B Node Fig.Scenario of wireless…
Wireless signal travels at the speed of light (3*10^8 meters/second). (20 points) 1) Calculate the minimum Round Trip Time (RTT) for the link. (4 points) 2. The rover is taking a picture of 5MB and sending the picture back to Earth. Assuming there are no transmission errors or other buffering…
Given an undirected graph without edge weights, you can customize breadth-first search to find the shortest path between a pair of vertices. Implement the method shortestPaths. Your method should return as soon as the shortest path is found. Public class Edge { int vnum; Edge next; …
import numpy A = numpy.linspace(0, 11, 12) A_list = [] A_list.append(A[0:3]) A_list.append(A[3:6]) A_list.append(A[6:9]) A_list.append(A[9:12]) B = numpy.linspace(11, 23, 12) B_list = [] B_list.append(B[0:3]) B_list.append(B[3:6]) B_list.append(B[6:9]) B_list.append(B[9:12]) e =…
Calculates its area and displays the result. 10 Q4: Differentiate in detail with examples between an array and a file. Q5: Differentiate between a class and an object, and explain in detail with example 2. Q6: What is the meaning of your name? Q7: Can we have both an object and a loop in the…
In Java, Convert the following while loop to a valid for loop that retains the same functionality: String[] names = new String[]{ "Tom", "Bob", "Tim", "Simon" }; int index = 0; boolean found = false; String nameToFind = "Tom"; // Do not change anything above here while ((!found) && (index <…
3.EXERCISE 2:ECOLOGICAL MODELING-2 of this systems can be described by the following model: (2) dA =YL-6A. ap (3 Questions: (1)Determine systems steady states. 2 Study the stability. Draw the nullclines and determine the vector field around each determined steady state as a function of the…
EMP_LOCS Ename Plocation P.K EMP_PROJ1 Ssn Pnumber Hours EPname P.K. R is decomposed to R, R, R as shown below. R = WORKS_ON = {SSN, Pnumber, Hours} Set of functional dependencies F is given as follows: Show whether the decomposed relations is lossy or lossless. Show the following table schema…
Define a structure and class and give one example for each.
Java Program Write a generic class named PairImpl that implements the interface below. A pair is a data container that holds two items of possibly different data types. For example, you could use it to hold a name (string) and an age (int). Once the class is implemented, write a program that…
Explain in detail what this program is all about? #include<iostream> using namespace std; class triangle { float base, height; public: void set_values(float, float); float area() { return 0.5 * base * height; } }; void triangle::set_values(float x, float y) { base = x; …
I am trying to read all the CSV files at once and print out the average into one data frame. "There are 5 files within the gapminder. Use a loop to create a dataframe that contains the average for each of the per capita GDP years with the index being the name of the region (which is in the…
Can I get the transition diagram for this asap, please? Thanks! -n to Parallel-out (SIPO) b. Use Logisim software to simulate the following shift register. PIPO circuit FFA Shift Register Parallel-in to Parallel-out (PIPO)
Problem 4 - Write SQL Triggers (6 points) Product (maker, model, type) Points PC (model, speed, ram, hd, price) Views on the following phase te Laptop (model, speed, ram, hd, screen, price) as.bore.displacement Printer (model, color, type, price) does not satisfy the stated constraint Write the…
Problem 3 -- Write SQL Constraints (6 points) Starts In movie Title, movie Year, star Name Movies (title, year, length, genre, studio Name, procedure #) Movie Star name, address, gender, birthdate Studio (name, address, pres C #) Movie Exec (name, address, cert #, net Worth) only. In SQL write…
a. LIKE b. BETWEEN c. DISTINCT d. GROUP 12. You can use the LIKE operator followed by a collection of values to provide a concise way of phrasing certain conditions. a. LIKE b. CONTAIN c. VALUES IN 13. A subquery within a subquery is called a subquery. 14. The DISTINCT operator eliminates…
4. Given the multi-word-block cache below: Address (showing bit positions 14-13.76-2.10) Data Tag Block Size 18 bits Data a) How many entries (blocks) does the cache have? b) How many words are in each block? c) How many total number of bits are in each block? d) For word address 1200, what is…
Task 2: Print character "Won" on the screen 150 times. Task 3: Print numbers on the screen from 100 to 200, executing upon a condition. NYIT - New York Institute of Technology Question 2 (25 points) completed.
(13) Given the following segment table: Segment number Limit Base 0 1000 1200 1 450 100 2 900 3000 3 1200 7000 What is the physical address for the logical address of segment 1, offset 300? Select one: A. 450 B. 300…
NYT NEW YORK INSTITUTE OF TECHNOLOGY Ie. On a LinkedList, deleting the LAST NODE method has the following lines. Complete the missing 2 parts: // Deleting the LAST NODE on a non-empty LinkedList public void deleteLastNode() { ListNode position = head; ListNode previous = null; …
Use the Euler method to create a MATLAB m-file that uses a time step size of 0.1 seconds to calculate the height of liquid in the tank as a function of time ranging from 0 to 12,000 seconds (200 minutes). The output of your script should be the final time to drain and a plot of height vs.…
Fill-in the state-assigned table for the following next-state and output logic expressions (6 points). Next State | Present State | w=0 | w=1 | Output (z) | y=0 | y=1 | y=0 | y=1 | -------------|---------------|-----|-----|------------|-----|-----|-----|-----| Y | w(!y+ty) |…
Reasoning the worst-case big O running time, assuming k values in the rule. Consider the following code to search for a target in a sorted array: public boolean search(int[] A, int target) { for (int i = 0; i < A.length; i++) { if (target == A[i]) { return true; …
I am trying to implement a readers-writers program and need help with the global section declarations. I've attached an image that highlights with red text what I need help with. #include <stdio.h> #include <pthread.h> #include <semaphore.h> #include <stdlib.h> #include <time.h> #include…
By using Android Studio, build the following: You are required to build an app that tracks personal expenses (food, rent, utilities, etc.). The main activity of the app should look as follows: My Expenses My Expenses My Expenses New Expenses My Expenses Totals Rent 5000 Food 4000 Utilities…
Oracle SQL LFM Skill table Skillcode Skillname Primary Key Unique BD Build Databases DD Design Databases MR Mobile Robotics AI Artificial Intelligence CS Cognitive Science LFM Employee table ID Lastname Primary Key NOT NULL Check to see that Lastname begins with O or A or B 5 Ow 10 Ogen 15…
Question 6 TCP/IP and Routing (15 points) drop and all packet are acknowledged before timeout.
a) You are picking a 64-bit fast adder to design for a group project in a subsequent course to this. Fan-out is strictly limited, and your primary design consideration is size and power, with performance coming second. The best fast adder design of the ones we have studied is suitable for your…
Assume that a newborn baby is a girl with probability p and a boy with probability 1 - p. Also assume that the genders of different newborns are independent of each other. Consider a person who has two children. Define the following two events: A ="both children are girls" B ="at least one of…
Write a C program that will allow two users to play a tic-tac-toe game. You should write the program such that two people can play the game without any special instructions (assume they know how to play the game). Prompt the first player (X) to enter their first move. Then draw the game board…
Explain-briefly the main ambiguity problem caused by the string matching problem. How to solve it?
Write a MATLAB code Task 1: Heart rate estimation from ECG signal An electrocardiograph (ECG) is a recording of the electrical activity of the heart. It can be used to detect several heart diseases and also to estimate the heart beat rate. Write a code that reads the ECG signal from a file…
Reference to the OutputStream named binobj. 6. Show 2 common constructors for the Label class. 7. What listener should be used with CheckBox?
Help 3.What method is used to tell if a RadioButton is selected? 4. What method is used to obtain text from a TextField called tf
NaeM 1.10 The implication (p > q) is equivalent to which of the following? a) p ∧ ¬q b) p ∨ ¬q c) p → q d) p ↔ q 2.10 Suppose that P(x, y, z) is a predicate where the universe for x, y, and z is {1, 2}. Also, suppose that the predicate is true in the following cases: P(1, 1, 1), P(1,…
cout << alpha[i] << ; 24. Given a 100-element, one-dimensional array beta, write a code fragment that could be used to print out the values of beta[0], beta[2], beta[4], and so forth (All variables are of type int.) 25. Given the declaration float alpha[75]; what is the valid index range of…
AME PROFESSIONAL ORTHOPAEDIC 8. fields An integer called invnum, a String called name, and a double called price handling.
EPP2 - Microsoft Visual Studio File pricelist - Notepad File Edit Format View Help 30430.99 Apple 740010.79 Coke Server Explorer 10078 3.29 Eggs 6ct 10079 6.00 Eggs 12ct 343022.49 Milk 1qt 59004 2.99 Bread wheat Toolbox
If a processor does not have a multiplier - it can multiple with help of true false - the program counter register false - dividers false - shifters true true true false - adding a series of shifted numbers
Access times are TLB=1, Cache=5, Main Memory=20, and MM miss ratio=0. True (False - if miss ratios are TLB=3/4, cache=3/4, the cache should not be used). True (False - if the miss ratios are TLB=4/5, cache=1/2, MM=0, the average access time is 12). True (False - if the miss ratio of the TLB=0,…
Inverters flip all bits in a register. Incrementers add 1 to a register. True False - If the output of an inverter was fed into another inverter, the overall output would be the input. True False - Inverters have a latency of 1 NOT gate. True False - An incrementer has the same latency as an…
A line of Java - if (C > 0) true false - requires a jump zero instruction false - uses the shifter true true false - requires a jump negative instruction false - compiles into many assembly instructions true
Fall 2018 Executing INT instructions, 190 s executed L/S instructions, and 20 s spent executing branch instructions. For all the other instruction classes remains unchanged? By how much is the time for L/S instructions reduced if the total time is reduced by 30% and the timings for all the…
In a Shuffle Exchange network true false - a 30 node network would need 5 stages false - the data does not travel along a bus false - a 10 node network would need 3 stages false - the nodes not are Fully Connected true true true
Hi, how are you? I need an answer plus a full explanation for this question. Please give a table as well. Many thanks. Problem 6 - Fill the table with IF, ID, EX, MEM, or WB, or space if delayed. Assume a pipelined RISC-V machine with no forwarding. Assume also that we can read and write any…
The expression 2 is equal to expression 1 or expression 2 multiplied by b-op2 and expression 1. The value of b-op2 is 1. Expression 1 is equal to expression 0 minus expression 1. The expression 0 is a constant variable. The expression 3 is the root of the uv trees and abstract syntax trees. The…
In cursive is written, "Don't use the find function." Question 2: Write a MATLAB function called my_fun that takes a vector of numeric values, nums, as input and returns a vector containing only the indices of nums whose values are non-zero. You are not allowed to use any built-in MATLAB…
Could I get a description of what you are doing in each line of code? I'm quite new to programming and need to write a report. This is done in MATLAB. Problem 1 [15 Marks] Write a script to evaluate the following piecewise linear function: a) Ask the user to input x values (using the input…
Write the void function named PrintMin that accepts a pair of integers and prints out the smaller of the two.
COSC241 Fall 2018 7. For the following BST, show the result of the order traversal: 27 1 20 11 12 / 17 7 / 29 7 Vinal. Exam 5 pts Answer: 8. Please convert the following infix expression to its corresponding postfix expression: s+c*b+d <5 pts> The equivalent postfix expression is Draw the BST…
QUESTION1 Which of the following best fits the definition of independent and identically distributed in machine learning? O There is a high probability the that model will work well on new data arriving after the model has been trained and tested. O Data which arrives after your model has been…
All other hashing methods create collisions. h. Linked List. Buckets.
The answer to Q2 is always contained in the answer to Q1. (dQ1 and Q2 produce different answers. Problem 5 (4 points): Relation Ra, b, c currently has the following instance: {1, 2, 3, 3, 4, 2, 2, 6, 1}. We make the following view definitions: CREATE VIEW AS SELECT ab AS d, c FROM R; CREATE…
Extra Credit (+5 Points): In programming assignment #4, you were tasked to implement a significant number of linked list functions. Similar to assignment #4, assume a linked list of students has been allocated on the heap. Write an additional function called cleanUp. This function should…
Text: Question #17: Assembly Language Function (10 points): Write a MIPS assembly language function that determines the maximum of two integers. For instance, if the user types in 5 and 10, the code below should print 10. If the user types in 45 and 30, the code should print 45. Make sure to…
Write the C++ code to: A. Create a node structure B. Allocate memory for a new node C. Initialize the contents of the node D. Set the pointers to NULL 10 points
Questions related to JavaFX 6. Name an advantage of using a Slider in place of a ScrollBar. 7. Can a Graphical User Interface, such as programs using JavaFX, use System.out.printO? If so, why would a GUI use System.out.printO? 8. What are the benefits of using a Slider in place of having a…
Please give me an example or draw some pictures to help me understand how it works. Let AecFG = {(G) | G is a CFG that generates ε}. Show that AecFG is decidable.
Create a valid HTML5 document that has a paragraph about any server-side technology of your choice. [10 points added to assignment]
RAID advisor, course department. Disakey/ID advisor together are a key ID course together are a key. Write this query in relational algebra. Write this query in SQL. Department other than their own. Write this query in relational algebra. Write this query in SQL.
Problem 8: 20 points Consider the following relational database schema: Student(ID, name, dept, status) // status = grad or undergrad* // ID is a key RA(ID, advisor, dept) // ID, advisor together are a key TA(ID, course, dept) // (ID, course) together are a key (a) Write this query in…
b) (4 points) Write an SQL request that, for each address, finds the total repaid amount for the address.
The following are executed: by A: GRANT UPDATE ON R TO B by A: GRANT UPDATE ON R TO C WITH GRANT OPTION by C: GRANT UPDATE ON R TO B WITH GRANT OPTION by A: REVOKE UPDATE ON R FROM C CASCADE Which of the following best describes the status of B's privileges on R? (a) B can update any attribute…
Please answer 18; it is very important. If you can answer the rest (15, 16, 17), I will appreciate your help. Thanks a lot. 16. Can a constructor be overloaded? Why? Inside the main function below the BankAccount class: private: string AccountNumber; string FullName; public: …
Assembly Language for x86 Processors. 9. Given a WORD, how would you load it into EBX register?
Assembly Language for x86 Processors. 7. How would you load the address of an array called arr into the EAX register?
Trying to find an answer for b. SaAB 99 = 99896 999. b. Describe the language generated by the grammar in part a using a formula.
Assembly Language for x86 Processors
After you execute the cmp instruction, how do you know the result? Explain the states of the relevant flags.
C++ and implementation file (Course.cpp). The class contains a dependency on a Section structure, which should have the following interface: struct Section { string section_code; // Section Code string days[2]; // Array of days section meets per week string times[2]; // Array of…
Example 1: sw $t2, 4($t0) lw $t2, 8($t0) sub $t4, $t2, $t3 add $t5, $t2, $t4 lw $t6, 0($t5) sw $t6, 4($t5)
Problem 1 - Page Replacement Strategies: In a virtual memory system implemented by paging, when a page fault occurs, we must bring in a new page. However, usually the operating system must choose a victim page to be removed from memory to make room for the newly-referenced page. a. Give at…
How do you convert a char to int and vice versa? In C++. My professor gave me this, but I don't understand it. Converting a char to int: char ch = 'x'; int x = ch - '0'; Converting an int to char: int in = 6; char ch = in + '0';
Help with an Algorithm Question 4. RSA, Primality Testing, and Factoring (a) Show that a = 2 is not a witness to the compositeness of p = 13. (b) Suppose a particular implementation of the Pollard rho algorithm factors a 100-bit RSA modulus in one minute. Use the running time heuristic to…
Assuming your student ID number is of the form "xxxxxxxAB", you will consider the values A and B in the sequel. For the questions you need to give numerical analysis, in other words, you need to try your implementations for different values and compare the results. Write a MATLAB…
Detailed inference steps. INITIALIZE-SINGLE-SOURCE(G, s) 1. for each vertex v in G.V 2. c = ∞ 3. v.Ï€ = NIL 4. v.d = 0 RELAX(u, v, w) 1. if v.d > u.d + w(u, v) 2. v.d = u.d + w(u, v) 3. v.Ï€ = u DIJKSTRA(G, w, s) 1. INITIALIZE-SINGLE-SOURCE(G, s) 2. S = ∅ 3. while Q ≠∅ 4. u =…
Text: expected output, including the table b and c. Input: X=GSTSAQBY=AGGTAB LCS-LENGTH(X,Y) 1 m=X.length 2 n=Y.length 3 let b[1..m,1..n] and c[0..m,0..n] be new tables 4 for i=1 to m 5 c[i,0] = 0 6 for j=0 to n 7 c[0,j] =…
MORDE-TREE-WALK(x) HIL 2 INORDER-TREE-WALK(x.left) PRINT x.key INORDER-TREE-WALK(x.right) Pseudocode: 1. The input tree 2.25 points Binary Search Tree a 5 points What property should a binary tree satisfy in order to be a binary search tree? b 15 points Given the pseudocode of Inorder…
Given the code below: #include <iostream> using namespace std; A) Complete the following linked list. B) Place m, x, and y as done in class, on the RAM below: RAM int main() { Byte0 Bytel Byte2 Byte3 int m = 20; int *x; int *y; x = &m; y = &m; …
EMT 2320 Degrees Apart: How many degrees will the rotor turn per step? 5 points 5. For the following Boolean equation (12 points total a, b, c): X = A + BA + CB + DAC + ABCD a) Write out the logic for the unsimplified equation. b) Simplify the equation. c) Write out the ladder logic for the…
Group C: [24 pts] Sorting algorithm 5 - Use ALEXSTOP to demonstrate how the quicksort algorithm works step by step. Please also use a stack to illustrate how the recursion of quicksort works. (12 pts) Program Dijkstra's 3-way partition algorithm in C++. And briefly explain the time complexity…
Group A: [27 pts] Assume that Alex is in charge of all 20,000 (N = 20,000) Fresno State students' academic consultation. He can only take care of up to 10 (M = 10) students per day, and let's assume the lowest GPA students have the highest priority. Based on what you've learned this semester,…
Using #include <iostream> using namespace std; int main() { int a = 4; cout << "Hello, World!" << endl; return 0; }
a. SDWORD myList 500 DUP (1) b. myList SDWORD 500 DUP(1) c. myList SDWORD 500 DUP(1) d. myList SDWORD 500 DUP(1) 29. The following are both valid data definition statements: a. List1 BYTE 10,20 b. BYTE 30,40 a. True b. False 30. The basic parts of an instruction, in order from left to…
4.20 Given the following directed graph, list the vertices which will be visited from A to F (use left to right search sequence): a. Breadth First Search: b. Depth First Search: ADJACENCY MATRIX: DESTINATION SOURCE 9EE CONNECTIVITY MATRIX: DESTINATION SOURCE A8E A 5.30…
Things You Can't Do Exercise: Explain what's wrong with the statements in the following function that are in colour: int * fn ( int ** n ){ int j = 7, k = 5; *n = &j; return &k; 1
Intelij Idea - Please "Java
In IntelliJ IDEA, please select "Java".
Consider a set of concurrent processes Pk that model the students entering a classroom to attend lectures. Due to energy constraints, it is required that lights in the classroom are only turned on when the first student enters and turned off when the last student leaves. The pseudo-code…
Using one-dimensional arrays, solve the following problem: a company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson that grosses $5000 in sales for a week receives 200 + 9% of $5000 for a…
I need help solving a given Python problem. Please use the function that is required for coding. Problem: A straight line can be defined by a pair of points p:(x, y) and p2(x, yz). The slope m of a line is defined as follows: m = (y2 - y1) / (x2 - x1). Your program reads the points from a…
Please help. Thank you. 8. Address Resolution Protocol is used for the translation of MAC addresses to IP addresses. 8.2. IP addresses are addressed to MAC addresses. 8.3. TCP addresses are translated to MAC addresses. 8.4. TCP addresses are translated to IP…
Please show me an example to help me understand how it works. Give implementation-level descriptions of Turing machines that decide the following languages over the alphabet {0,1}: b.Kw| w contains twice as many 0s as 1s.
The string Samuel, the row will not be found. 25 - True - False. An SQL identifier, such as a table name, can be no longer than 64 characters. 26 - True - False: COUNT, SUM, and AVG apply to both numeric and nonnumeric fields. 27 - True - False. The referential action CASCADE allows deleting a…
Subject: You are a network administrator in NASR company. This company has around 5000 employees distributed in 5 branches. It also has around 600 PCs, a web server, a file server, and around 50 printers. The employees may need access to the local web and/or FTP servers, and they can also…
Before A: An example is shown below: 3 Question 2: (6+9) points 1 2 3 5 2 0 8 The function has to be general for any 2D array of any size. 193 Note: Assume that M is defined as a constant outside the function definition. Don't use scanf and/or printf in the function definition. Assume that…
JS events - what are they, how do you use them, what are some examples? JS OOP - how do you define a class? Methods? Instantiate a class? JS Closures - what are they? How are they used?
Write Java code according to the comments. Total 14 points. public static void main(String[] args) { } //end main public static void show(String s, int n) { System.out.println("COMP2243 " + n); } public static double calculate(int x, String s, double y) { return x +…
Text: list BIVAALE. Then count(list) will return 4, 5, 10, 15, 6, 3043, 9, 608, 80, 12pt AT Paragraph 4 X. Write a method called count that counts the number of single-digit values in an array of integer values. For example: iii ii words.
For the weighted graph given below, use the algorithm discussed in steps 1 and 2 to redraw the graph along with the indices and candidate class to find the shortest path from a to z. Be sure to show all of your shortest paths each time that the nodes are reindexed.
BIVAA Question 6: public static int count(String str, char ch) method using the following header: 12pt 4 MII Paragraph 9 (Occurrences of a specified character). Write a method that finds the number of occurrences of a specified character in the input string.
Text: Need help with question 9 9. Here is a brief program that creates a couple of arrays and puts Warthogs (see previous question) on them. Draw a picture of the contents of memory (the two array lists and the warthog objects with their instance variable values) at the point in the program…
Here is a simple little class that tests if a number is even or not. Write a Junit test class that tests the isEven method. Be sure to test all cases. public class NumberFun { public static boolean isEven(int n) { return n % 2 == 0; } }
The text provided below shows the message-passing primitives used in the operating system. Each process (Pi=1,2,N) has a section where it can request permission to enter the critical section (CS). The cs_mgr process is responsible for granting permission to the requesting processes and managing…
A graph is given by the adjacency matrix. Give a pictorial representation for the graph and draw the data structure (as discussed in class) for adjacency list representation for this graph. 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0
(5 points) Based on the graph and your answer above, please design a Turing machine that 0.
QUESTION 3 A group of people has n men and n women. In how many ways can a line be created such that men and women alternate? 0(2n) 0 2(n!) 0 2(n!2)
A binary search tree is to be built using the algorithm given in class. The following numbers are input in the order given: 30, 50, 15, 60, 40, 10, 20, 70, 55, 45, 47, 46, 56, 59, and 57. Draw the resulting tree.
Select the true statements. J7n+1 The coefficient of xy in the expansion of (x + y)^17 is The coefficient of xy in the expansion of (x + y)^17
Please enter your name here: 40 20 + 20 20/30 1 P = R P = 24.50 P = 11.5aW
QUESTION 8 0 263 (26) (23) 0 26! 3! 0 26! 23!
PLEASE DO 5 ITERATIONS OF EULER METHOD W/ H=0.1 USE EXCEL TO PLOT THIS SYSTEM OF EQUATIONS AND USE THE EULER METHOD TO SOLVE FOR CONVERGENCE, SHOW EQUATIONS USED IN CELLS Lotka-Volterra Population Model Given the following predator-prey relationship: Y1' = -0.1y1 + 0.02y1Y2 (predator) Y2'…
For the weighted graph given below, use the algorithm discussed in class to find the shortest path from a to z. Be sure to show all of your steps and to redraw the graph along with the indices and candidate shortest paths each time that the nodes are…
Algorithm given in class, redraw the array each time that an entry changes. You may redraw only once for each swap. Be sure to indicate which elements are being swapped.
Prove by mathematical induction that T(n) = n^2 is the solution to the recurrence relation T(0) = 0 and T(n) = 2n + T(n-1).
To support the collaboration between UPS and Pizza Sop, suggest a simple but meaningful and persuasive web architecture. Pizza Company UPS Driver UPS Maintain the vehicle (repairs, servicing) BIRCH UPS Technology is used to manage deliveries (GPS)
Text: MATLAB Problem 6 (a) Write a function that takes three input arguments (numbers) x, y, z and then returns the average of the three numbers. (b) Write a program that: (1) Solicits from the user three values, (2) Calls the function that you wrote above for part (a) to compute the average,…
Question 5: One of the following sets is c.e. and the other is not. 1. {M: |L(M)| = 330}, 2. {M: |L(M)| = 330} where M is a Turing machine description, L(M) represents the language recognized by M, and |L(M)| denotes the size of this language. Identify which set is c.e. and which is not, and…
accepting states. 3. Convert the NFA to a DFA. Show the transition table. Clearly mark al
Given the array int test = {1, 2, 3, 4, 5, 6}: a) Write the loop without pointers to print out: 1 2 3 4 5 6. b) Using pointers, print out the same output using * notation. c) Write the output for the following program: #include <iostream> using namespace std; int main() { int r = 5, *q =…
What is multithreading? Comp sci question homework. (c) (3 points) What does the keyword synchronized mean in the context of Multithreading? (d) (5 points) Explain the top 4 benefits of using multithreading. Clearly, all four benefits are targeted towards a particular initiative. What is that…
Text: Basic Comp sci questions closure & Nash homework 12. (4 points) Fill in the blanks below. a) 11 b) 8 c) We discussed in class. We looked at two different solutions to solve this problem. Let us suppose you are using shallow binding, what is the output value that gets printed by the…
In Prolog, define a predicate sagranny(X, Z) that checks if X is a grandmother of Z and a predicate hasSibling(X) that checks if X has a sibling. Also, define several facts and include them before your predicate definitions, such that querying your defined predicates would produce at least one…
Let p = 3 mod 4 be a prime number. Show that x ≡ -1 mod p has no solutions. Hint: Suppose such an r exists. Raise both sides of the equation to the power p-1 and use Fermat's theorem.
Text: Memory address questions homework 3.9 points each Given the following declaration, assume a[0][0] is at location 5001 char array[][] = new char[7][9]; a) (3 points) At what memory address is array[5][7] located if row-major ordering is used? (A char requires 1 byte.) b) (3 points) Same…
ANSWER QUESTION 3 Consider the problem of factoring - decomposing a number N into its composite factors (e.g., 2881 = 67 * 43). This is generally understood to be a hard problem (in that the difficulty increases rapidly with N). For some N, however, factoring can actually be quite…
I need help with this, please. This is an incomplete Java program for BMI (Body Mass Index) calculation. Fill out the statements in the blanks with the following: 1. Enter your Height in inches: 2. int wt, ht // weight & height of a person in metric units 3. float b; // BMI value 4.…
Hello there! The following is an Artificial Intelligence question. Need serious help, please! Consider the search problem below with start state 'S' and goal state 'G'. The transition costs are next to the edges, and the heuristic values are next to the states. a) What is the Search Cost and…
Combine these two statements into one GUI statement to get the integer value from user input: String tStr = JOptionPane.showInputDialog("Enter an integer value"); int t = Integer.parseInt(tStr); What is the output produced by the following code: double iR = -0.05; double ip = iR * 100; double…
Please help me with these with explanations. I am confused about the concept and 0xD000000000000000, respectively 2.10.1 [5]<52.4> What is the value of 30 for the following assembly code? add x30.5, x6 2.10.2 [5]<52.4> Is the result in 30 the desired result, or has there been overflow? 2.10.3…
Please I need help with 11, 12, and 13. 11 ANS: double ANS: Line1) Line(2) ANS: double eB double bB iP double iR Line(1) = 2000 = iR * 100 = 0.05; What is the O/P produced by the following code: int t = Integer.parseInt(tStr); = bB * 1 + iR) --- statements that do the processing are here ---…
Text: Java 1. In the following code, the marked lines contain errors. For each part, answer the question about the error. (25 points) Part 1: What is the error at line a? interface A { void mi } class B implements A { void m1() { // System.out.println=i); } } Part 2:…
Please help me to write program 2 and 3. Exercises: Program 1: Program 8.2 in Chapter 8, pp. 167 of the textbook can determine tomorrow's date. Please rewrite program 8.2 with pointers to structures. Program 2: Write a program to construct a dictionary. Refer to program 9.9 on pp. 219 of the…
The round-trip time. The problem? (ii) RTT might exhibit high variance. (e) In the context of TCP, (iv) Describe how the timeout value is computed. Explain why the Round Trip Time. (ii) Compare the simple average and the exponential average methods for estimating.
1. Answer to a int doIt{} 2. integer x = 3.0; 3. class MyClass { 4. Answer to e 5. Answer to d 6. Answer to bc MyClass boolean b { 7. b = b; 8. } 9. 5 - 4 - (3 - 1) and average sect
Write a Java program that implements the following diagram: a. Create the Superclass Shape b. Create the Subclass Rectangle c. Create the Subclass Triangle Shape: - getArea(): double - toString(): String - getColor(): String Rectangle: - length: int - width: int - getArea(): double -…
In the network connection shown in Figure Q3, a web server is hosted by Computer C and an FTP server is hosted by Computer D. Computer A and Computer B are connected via an Ethernet switch. IP: 149.152.130.99 MAC: 22:44:11:BB:AA:FF IP: 158.145.205.160 MAC: 33:22:88:CC:AA:DD IP: 192.168.0.1…
Problem 5 - Consider a program consisting of 100 1D instructions in which each instruction is dependent on the instruction immediately preceding it, e.g., 1D x2,0(x1) 1D x3,0(x2) 1D x4,0(x3). What would the average CPI be in the pipelined processor with forwarding?
Problem 3 - Consider the following 16-bit floating-point number system in which we use 1 bit for the sign, 5 bits for the exponent, and 10 bits for the significand (mantissa). The exponent bias is equal to 16, and the largest and smallest biased exponents are reserved (similar to IEEE 754…
Explain how the IP packet described would be fragmented. 15 marks connected through the Ethernet transmission link and the second network has an MTU of network segments before it reaches its destination. The first intermediate network is An IP packet of size 8500 bytes with a header size of 20…
Please disregard the answers. They are not correct. Please answer correctly 17-21. 17. What is TRUE: 1) Hard real-time tasks must be executed exactly at specified time moments. 2) Soft real-time tasks never have deadlines. 3) Hard real-time tasks are not always periodic tasks. 4) Round-robin…
Watch the TED Talk: How to Find the Work You Love by Scott Dinsmore and complete the worksheet. View the TED Talk and complete the following grid. If you run out of space on the grid for any of your answers, feel free to continue writing on the back of this sheet. Title of TED Talk: Name of…
C++ 4. Complete Binary Tree implemented as an array. Insert elements (i.e. build the tree) - write the C++ code for a binary search (you have an ordered array) - Binary Search Tree (see slides), how to create, add, and delete items. For example, given values, create a binary search tree, add a…
Please disregard the answers. They are not correct. Please answer correctly. 1-6 We call this process management method: 1) Preemptive; 2) Nonpreemptive; 3) Interactive; 4) Non-scheduled; 5) Real-time. 2. Real physical address appears in the program: 1) After a programmer finishes writing a…
Problem #9: Modify an Euler Method code that finds the solution of the differential equation given below: With the initial condition of y0 = 3 at x0 = 2. Use the range of x from x = 2 to x = 3 and a step size of 0.1 to compute the value of y using the Euler Method C function created. Do the…
Problem #8: Develop a C code to integrate the definite integral I = ∫ using the Trapezoidal Rule and the Simpson's Rule with both 10 and 20 intervals. Develop the C-function for the Trapezoidal Rule and bring the computed numerical integral value to the main function before printing the…
Problem #7: Develop a C code with a C-function for Gaussian Elimination Method to solve the equations given below: Show the following output: - Print the code Title - Print with words the Given Left Hand Coefficient Matrix [A] of the given equation [A]{x}={B}, where x is the unknown vector…
Problem #6: The following table gives the percentage of acetic acid ionized (P) at different concentrations (C) in moles per liter. Develop a C program code to obtain the least model equation Phat(c) = b0 + b1 * c. C | P 0.10 | 1.35 0.05 | 1.91 0.02 | 2.99 0.0098 | 4.22 0.0059 |…
Problem #4: Develop a C code to calculate the average, median, and standard deviation using 5 numbers as data input from the keyboard. Compare the program output with the hand calculations shown with formulas for average, median, and standard deviation. Use the suggested approach below for…
For this assignment, you are to implement the String class, the specification of which is shown below. Using this String class, you are then to implement an application to sort a sequence of words input by the user. This application should begin by asking the user how many words, not to exceed…
Can anyone write this code in assembly language? Please and thank you. #include <bits/stdc++.h> using namespace std; int main() { int n; cout << "Enter the number of players: "; cin >> n; string b[n]; int a[n]; for(int i = 0; i < n; i++) { //initialize all the…
Most of the code is there already. I just need to know what "a=", what "b=" and what the last "C=". In Python please. Write a function named centroid_init(Z, K) that takes as input a data numpy array Z and the number K of clusters to group the data into, and returns as output a numpy array C…
Write a Python class to represent a Course. The course has an ID, Name, and a score in 5 tests. The score for each test is out of 100. # Code to test the Course class SE320 = Course() s1.scores.append(82) s1.scores.append(85) s1.scores.append(68) s1.scores.append(71) print(s1.percentage())
Scammelse hport refers to a Scanner object called stdin. LassEranfoleK. You may assume you are in a main method in a properly-defined class and that you have a Hretthie nd ifeger.
TaxApp Create an associative array with 5 elements to hold the Name, Gross Income, and Tax Status (i.e. Single, Married) of a Person. Use a Person class to store the Name, Income, Tax Status, Tax Rate, Net Income, and Gross Income. Iterate through each array to create instances of the Person…
The statements card1 = "hi mom" card2 = 3 card3 = Card() my_card = card3 card2 = card1 card1 = Card() will cause how many Card objects to be instantiated? (only one correct choice): 1 2 none 4 5
Using the diagram above, we have to write a SQL query for question 1 letters A and B. From my understanding, 'Swing' is a CD title. CDlibrary V5.0 GROUP-CD GROUP *grpid grpname PERSON-GROUP employee) PERSON *psnid psntname psniname PERSON-COMPOSITION "psncomprole psncomporder PERSON-CD…
Problem 1: Timestable Charts using C++ Program Since you obviously need to start planning for kids at your age, let's write a simple program you can use to print off timestable charts when your future children need to learn multiplication. Create a well-laid-out chart. It should not allow the…
Given the following table of processes: Process Arrival Burst CPU time A 0 3 B 1 1 C 2 4 D 3 2 E 4 3 Apply the RR algorithm for scheduling them with q=2
Here you can achieve with these drives if you use NRAIDS (c)RAID1S (RAID10). Draw the RAID configurations you propose. (6 points)
A single table is used for frames. Calculate the minimum and maximum memory required for keeping the page tables if: 1. A system that is using paging has 50-bit physical addresses, 64-bit logical addresses, and 16kB split between the two levels. 2. A two-level hierarchy of tables is used. You…
i kB. Show all the calculations. g = 7. Offset = 109. eg = 3. Offset = 100. Seg = 9. Offset = 0. Segment Table Base Address [Length 118872, 1, 905, 89596, 2, 342, 61527, 3, 1494, 559, 481, 4, 95544, 5, 28, 68253, 6, 768, 96757, 1249, 36191, 390, 19886, 6, 2, 30571, 536, 10, 111414, 931. Page…
Image processing software, such as satellite image processing software, is made up of two types of threads: feed threads that communicate with the satellite and fetch the image data, and processing threads that process the images and store them on hard drives. A crucial component in this…
[10 marks] Write HTML and JavaScript code for a complete web page that draws a yellow filled rectangle on a red background on an HTML canvas. The canvas should be 800 pixels wide x 400 pixels high; the rectangle should be 100 pixels high x 50 pixels wide, positioned on the lower left of the…
I need the flow graph/table drawn for this, demonstrating how the below (presumed correct) outputs were derived. Exceptional control flow. Consider the following C program. (For space reasons, we are not checking error return codes, so assume that all functions return normally.) int main() { …
Please write in assembly x86 #include<iostream> #include<bits/stdc++.h> using namespace std; int main() { int n, m, p, q = 0; cout << "Welcome to the game" << endl; cout << "Enter the number of players: "; cin >> n; int a[n]; string b[n]; for(int i = 0; i < n; i++)…
10. Assume Write lines of code that will accomplish each of these three tasks. Circles are TNodes, use left and right to refer to the children. Squares are TNode *refer to them based on their labels (root or cuz). When nodes are removed, make sure to not leave any orphaned memory (14…
A company makes products A and B from 2 resources, labor and material. The company wants to determine the selling price which will maximize profits. A unit of A costs $30 to make and demand is estimated to be 50 - 0.09 * Price of A. A unit of B costs $20 to make and demand is estimated to be 30…
Short answer please without Explanation What is the first program to execute when a Desktop computer is powered on, and what is its purpose?
Mat 172-ZH81-Pre-Calculus [Extra Credit] Please solve this maze and write down the process it took for you to do it in words.
A class can implement more than one interface type. In Java, a subclass has no access to the public instance variables of the superclass. T public. All methods in an interface must be explicitly declared as private or all methods in the interface are automatically public. T Extreme Programming…
Java Recreate the screenshot below. For reference, the frame is 300 x 300 pixels. The number display is in a different panel than the number buttons (along with the "C" and "." buttons). I have provided the initial setup, along with the numberDisplay JLabel. You must provide the…
Hi, could you help me with these three short questions please? 4. An array can be (Select all that apply): a) created with new, b) of a primitive type, c) of a class type, d) declared but not created, e) of length 10,000. 5. A class method can (Select all that apply): a) return a boolean, b)…
V Letter Pair Frequencies def letter_pair_freqs(words): Given a list of words guaranteed to consist of lowercase English letters a to z, only count how many times each one of the 26*26 possible pairs of letters occurs inside these words. Return the answer as a Python dictionary that maps…
1. What is the memory address (cell number) of the last instruction that would be executed? 2. When the program starts executing, what value will be stored in register 2? 3. When the program stops executing, what value would be stored in memory cell 54? For Questions #11-13, please refer to…
Quick Exercise C14a-3 Find out IPv4 addresses of the following hosts and indicate the class to which the IP addresses belong: 1. www.sci.brooklyn.cuny.edu 2. www.drsr.sk 3. www.google.com Remark: There are many ways to find out the IP address of a host given a domain name. For example, you…
d) four c) three b) two a) one X = z; B2 = X + 1 N B1: wait T; int Z; Process B signal T; A2: X = Y; A1: Y = X * 2; int Y; Process A T is set to 0 before either process begins execution and, as before, X is set to 5. 8. The program follows to use a shared binary semaphore T: Now, how many…
I need an explanation of the answer. d) 12 L (5 b) 2 a) 42 (GATE 1987) 5. At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operation.
Consider the following program fragment: addi $s6, $s3, 1 ape $t1, $ti, $s6 lw $s6, 0($t1) sw $s6, 0($t1) beq $t1, $t2, L ape $s6, $t2, $t2 L: apd $t3, $t1, $s6 In a previous homework, you identified all data and control hazards assuming an infinite stage pipeline. Repeat the problem, but…
For the given virtual addresses, indicate the TLB entry accessed and the physical address. Indicate whether the TLB misses and whether a page fault occurs. If there is a page fault, enter for PPN and leave part C blank. Virtual address: 2F09 Virtual address format: one bit per box 15 14 13 12…
Consider an allocator that uses an explicit free list. Each memory block, either allocated or free, has a size that is a multiple of sixteen bytes, and each payload must be aligned on a 16-byte boundary. The format of the header/footer is as in your malloc lab (low bit indicates whether the…
Possible words in Hangman def possible_words(words, pattern): Given a list of possible words and a pattern string that is guaranteed to contain only lowercase English letters a to z and asterisk characters *, create and return a list of words that match the pattern in the sense of the game of…
Q9: Write a function called downOdds that forms a new number from a non-negative integer parameter by decreasing all odd digits. In case a negative parameter is given, an answer of 0 is to be returned. For example, a program that uses the function downOdds follows: int main() { cout <<…
3y)[~Ky(x)Fyx Kx)] ~(y)FyY Add Line ->Begin Subproof
def riffle(items): Given a list of items that is guaranteed to contain an even number of elements (note that the integer zero is an even number), create and return a list produced by performing a perfect riffle to the items. When performing a perfect riffle, also known as the Faro shuffle,…
We have the following information about the students in one of ME 2800 sections: 1. There are 30 students in this section. 2. 6 students are either freshmen or sophomores. 3. The number of senior students is twice the number of junior ones. 4. There are 3 more junior students than sophomore…
Write a working C program that will calculate the total capacitance, electrical charge, and rms voltage drops across the set of two capacitors in series when connected to a 12V AC supply as shown below: C1 ---- A ---- I ---- B ---- I2 | | Vc1 Vca …
Text: C++ Programming Language 27. Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, write a complete program that uses a for loop to print a single line consisting of n asterisks. Thus, if n…
Exercise A EK = -74 mV ENa = +58 mV E = -47 mV K = 36 mS/cm^2 Na = 120 mS/cm^2 9L = 0.3 mS/cm^2 Cm = 1.0 F/cm^2 t = 0.05 ms Table 1: Standard parameter values for the Hodgkin-Huxley model. Use the finite difference method and the standard parameter values in Table 1 (above) to compute the state…
Suppose that we have six C functions that together solve some problem. Suppose these functions depend on each other according to the following dependency graph. Write a sketch of a C program that uses Pthreads to execute the above six functions in a way that is maximally parallel but adheres to…
Determine several ways to analyze. You should have several different charts and graphs and use functions and formulas, what-if analysis, pivot tables and charts, trendlines, etc. Use solver and scenarios and create macros. Put your charts, etc. on separate sheets and be sure to label…
Java TYM shing>entry NYIT YM NEW YORK INSTITUTE OF TECHNOLOGY Question 3B (15 points): Write into LinkedList structure by READING MONTH NAMES FROM the above HashMap and write into this new LinkedList (assume AddNodeToStart/End methods in StringLinkedList already exist)
Write a MATLAB function which takes coordinates of 3 vertices of a triangle as inputs and then calculates and returns its perimeter as the output. For the function name and input/output arguments, use: Perimeter = tri_perimeter(PA, PB, PC) The function should be able to handle…
Java CSCI185 FIM NYIT NEW YORK INSTITUTE OF TECHNOLOGY Question 2) (25 points) Task 1: Print numbers on the screen 1 to 99 Task 3: Print numbers on the screen 100 to 200 (executes upon condition) Task 2: Print character W on the screen 150 times Task 3 is started to execute only when Task…
Text: Database Name: Part 2 - SQL (20 points) For each of the following numbered tasks, provide the SQL statements and the results. Use appropriate data types and data shown in the sample database. Tables: Title (titleCode, titleDescription, salary) Department (deptCode, deptName,…
Q2: Can a file pointer be void? Yes/no, explain.
5[101520252830 yalue 96 is inserted into the B+ tree. node is approximately 200. Calculate average fan-out and height of the B+ tree. a node takes 12 bytes and the size of a pointer in a node is 8 bytes. Let us assume we have total b Let us assume that a node of a B+ tree is implemented as a…
Q1: Explain the following terms in detail with examples: a) Object b) Member function c) Constructor d) Destructor
Q2: Can a file pointer be void? Yes/no explain. Q3: A) Write a program in C++ which accepts the radius of a circle from the user, calculates its area, and displays the result.
2. Trace the quick sort algo on the following array and show the recursion tree. Use the first item as the pivot when doing a split 24.6.72.28.12.9.3
3. Consider the following figure in wireless networks. A communicates with B, and B communicates with C. What could be a problem in such communication? How to solve it (Please draw a figure to explain the solution?(5 pts) Node A sees Node B Node Csees Node B Node Fig.Scenario of wireless…
Wireless signal travels at the speed of light (3*10^8 meters/second). (20 points) 1) Calculate the minimum Round Trip Time (RTT) for the link. (4 points) 2. The rover is taking a picture of 5MB and sending the picture back to Earth. Assuming there are no transmission errors or other buffering…
Given an undirected graph without edge weights, you can customize breadth-first search to find the shortest path between a pair of vertices. Implement the method shortestPaths. Your method should return as soon as the shortest path is found. Public class Edge { int vnum; Edge next; …
import numpy A = numpy.linspace(0, 11, 12) A_list = [] A_list.append(A[0:3]) A_list.append(A[3:6]) A_list.append(A[6:9]) A_list.append(A[9:12]) B = numpy.linspace(11, 23, 12) B_list = [] B_list.append(B[0:3]) B_list.append(B[3:6]) B_list.append(B[6:9]) B_list.append(B[9:12]) e =…
Calculates its area and displays the result. 10 Q4: Differentiate in detail with examples between an array and a file. Q5: Differentiate between a class and an object, and explain in detail with example 2. Q6: What is the meaning of your name? Q7: Can we have both an object and a loop in the…
In Java, Convert the following while loop to a valid for loop that retains the same functionality: String[] names = new String[]{ "Tom", "Bob", "Tim", "Simon" }; int index = 0; boolean found = false; String nameToFind = "Tom"; // Do not change anything above here while ((!found) && (index <…
3.EXERCISE 2:ECOLOGICAL MODELING-2 of this systems can be described by the following model: (2) dA =YL-6A. ap (3 Questions: (1)Determine systems steady states. 2 Study the stability. Draw the nullclines and determine the vector field around each determined steady state as a function of the…
EMP_LOCS Ename Plocation P.K EMP_PROJ1 Ssn Pnumber Hours EPname P.K. R is decomposed to R, R, R as shown below. R = WORKS_ON = {SSN, Pnumber, Hours} Set of functional dependencies F is given as follows: Show whether the decomposed relations is lossy or lossless. Show the following table schema…
Define a structure and class and give one example for each.
Java Program Write a generic class named PairImpl that implements the interface below. A pair is a data container that holds two items of possibly different data types. For example, you could use it to hold a name (string) and an age (int). Once the class is implemented, write a program that…
Explain in detail what this program is all about? #include<iostream> using namespace std; class triangle { float base, height; public: void set_values(float, float); float area() { return 0.5 * base * height; } }; void triangle::set_values(float x, float y) { base = x; …
I am trying to read all the CSV files at once and print out the average into one data frame. "There are 5 files within the gapminder. Use a loop to create a dataframe that contains the average for each of the per capita GDP years with the index being the name of the region (which is in the…
Can I get the transition diagram for this asap, please? Thanks! -n to Parallel-out (SIPO) b. Use Logisim software to simulate the following shift register. PIPO circuit FFA Shift Register Parallel-in to Parallel-out (PIPO)
Problem 4 - Write SQL Triggers (6 points) Product (maker, model, type) Points PC (model, speed, ram, hd, price) Views on the following phase te Laptop (model, speed, ram, hd, screen, price) as.bore.displacement Printer (model, color, type, price) does not satisfy the stated constraint Write the…
Problem 3 -- Write SQL Constraints (6 points) Starts In movie Title, movie Year, star Name Movies (title, year, length, genre, studio Name, procedure #) Movie Star name, address, gender, birthdate Studio (name, address, pres C #) Movie Exec (name, address, cert #, net Worth) only. In SQL write…
a. LIKE b. BETWEEN c. DISTINCT d. GROUP 12. You can use the LIKE operator followed by a collection of values to provide a concise way of phrasing certain conditions. a. LIKE b. CONTAIN c. VALUES IN 13. A subquery within a subquery is called a subquery. 14. The DISTINCT operator eliminates…
4. Given the multi-word-block cache below: Address (showing bit positions 14-13.76-2.10) Data Tag Block Size 18 bits Data a) How many entries (blocks) does the cache have? b) How many words are in each block? c) How many total number of bits are in each block? d) For word address 1200, what is…
Task 2: Print character "Won" on the screen 150 times. Task 3: Print numbers on the screen from 100 to 200, executing upon a condition. NYIT - New York Institute of Technology Question 2 (25 points) completed.
(13) Given the following segment table: Segment number Limit Base 0 1000 1200 1 450 100 2 900 3000 3 1200 7000 What is the physical address for the logical address of segment 1, offset 300? Select one: A. 450 B. 300…
NYT NEW YORK INSTITUTE OF TECHNOLOGY Ie. On a LinkedList, deleting the LAST NODE method has the following lines. Complete the missing 2 parts: // Deleting the LAST NODE on a non-empty LinkedList public void deleteLastNode() { ListNode position = head; ListNode previous = null; …
Use the Euler method to create a MATLAB m-file that uses a time step size of 0.1 seconds to calculate the height of liquid in the tank as a function of time ranging from 0 to 12,000 seconds (200 minutes). The output of your script should be the final time to drain and a plot of height vs.…
Fill-in the state-assigned table for the following next-state and output logic expressions (6 points). Next State | Present State | w=0 | w=1 | Output (z) | y=0 | y=1 | y=0 | y=1 | -------------|---------------|-----|-----|------------|-----|-----|-----|-----| Y | w(!y+ty) |…
Reasoning the worst-case big O running time, assuming k values in the rule. Consider the following code to search for a target in a sorted array: public boolean search(int[] A, int target) { for (int i = 0; i < A.length; i++) { if (target == A[i]) { return true; …
I am trying to implement a readers-writers program and need help with the global section declarations. I've attached an image that highlights with red text what I need help with. #include <stdio.h> #include <pthread.h> #include <semaphore.h> #include <stdlib.h> #include <time.h> #include…
By using Android Studio, build the following: You are required to build an app that tracks personal expenses (food, rent, utilities, etc.). The main activity of the app should look as follows: My Expenses My Expenses My Expenses New Expenses My Expenses Totals Rent 5000 Food 4000 Utilities…
Oracle SQL LFM Skill table Skillcode Skillname Primary Key Unique BD Build Databases DD Design Databases MR Mobile Robotics AI Artificial Intelligence CS Cognitive Science LFM Employee table ID Lastname Primary Key NOT NULL Check to see that Lastname begins with O or A or B 5 Ow 10 Ogen 15…
Question 6 TCP/IP and Routing (15 points) drop and all packet are acknowledged before timeout.
a) You are picking a 64-bit fast adder to design for a group project in a subsequent course to this. Fan-out is strictly limited, and your primary design consideration is size and power, with performance coming second. The best fast adder design of the ones we have studied is suitable for your…
1
...
897
898
899
900
901
...
903