Transcribed Image Text from this Question2. (8 marks] Suppose you wanted to construct an abstract syntax tree from parse tree derived by using the grammar specified in Figure 1. Give an S-attributed grammar that creates an abstract syntax tree composed of the following kinds of tree nodes as illustrated in the UML diagram below. ASTNode LiteralASTNode LiteralASTNode (Number) ListASTNode ListASTNode (ASTNode) prependNode(ASTNode) : void appendNode (ASTNode) : void IdentifierASTNode IdentifierASTNode(String) QuotedASTNode QuotedASTNode (ASTNode) All that is required is to create an abstract syntax tree. Observe that all you will need for most types of nodes is just the constructor (as shown) but for ListASTNode two methods are provided to prepend and append nodes to a list. You will need one of these methods, depending on how you structure your attribute grammar. Please provide both the semantic rules and the attributes using notation similar to that in question 1. Provide a brief explanation of how the grammar works. 1 S → Atoms Atoms Atoms → Atom Atoms Atom Atom Atom id Atom int Atom → (Atoms ) Figure 1: A simplified grammar for Scheme.
A) (4 Points) Compute The Remainder And The Quotient For 1) 46 Div 22
Transcribed Image Text from this Questiona) (4 points) Compute the remainder and the quotient for 1) 46 div 22 = 46 mod 22 = 2) -3 div -4 = -3 mod -4 = b) (2 points) Find the prime factorization in canonical form for 165 165= c) (6 points) Find GCD(55,230), GCD(-7,13) using Euclidean Algorithm d) (2 points) Which of the above pairs are relatively prime? why? e) (2 points) Find LCM(55,230)
Come Up With A Recurrence Relation (mathematical Expression Of The Recursive Function) For
Come up with a recurrence relation (mathematical expression of the recursive function) for method 1. Do this please before you start coding. Write recursive static Java methods to solve the problems stated below. The following describes the behavior of these methods. Method 1: write a recursive method, called sumover, that takes one integer parameter n, which is a non-negative integer. The method returns a double value, which is the sum of the reciprocals of the first n positive integers, where the reciprocal of x is the fraction 1/x. For example, sumover(1) returns 1.0 (which is 1/1); sumover(2) returns 1.5 (which is 1/1 1/2 ); and sumover(3) returns approximately 1.833 (which is 1/1 1/2 1/3 ). Define sumover(0) to be zero. Do not use any local variables in your method. Method 2: Write a recursive method, called printAstricks, that takes two integer parameters, m and n such that 0 <= m and m <= n. The method prints a line of m asterisks, then a line of m 1 asterisks, and so on up to a line of n asterisks. Then the same pattern is repeated backward: a line of n asterisks, then n-1, and so on down to m. For example, printAstricks(3,6) print the following: *** **** ***** ****** ****** ***** **** *** The only loop allowed in your implementation is a loop to print a line of m asterisks. You may have two copies of this loop in different places of the implementation. REQUIREMENTS 1. Should use the application driver supplied here and produce correct results: public class Homework7 { public static void main(String[] args) { System.out.println(sumover(2)); System.out.println(); printAstricks(4, 7); } // supply sumover() method in the space below // supply printAstricks() method in the space below } The program is robust with no runtime errors or problems; it produces outputs that Meet the requirement. REQUIRED WORK You are asked to the following to get points: 1. (6 pts) Write the mathematical formula for method 1 in the space below SUPPLY THE MATH FORMULA IN THE SPACE BELOW TO SCORE YOUR POINTS: 2. (10 pts) Put your complete Java source code for method 1 SUPPLY THE SOURCE CODE OF METHOD1 IN THE SPACE BELOW TO SCORE YOUR POINTS: 3. (10 pts) Put your complete Java source code for method 2 SUPPLY THE SOURCE CODE OF METHOD2 IN THE SPACE BELOW TO SCORE YOUR POINTS: (14 pts) Incorporate your 2 methods into the application driver supplied. Run the program, then do the screen captures SUPPLY OUTPUTS THAT PROVE PROGRAM’S CORRECTNESS IN THE SPACE BELOW TO SCORE YOUR POINTS: step by step please like Write recursive static Java methods to solve the problems, step one to step 4 i really appreciate thanks
8.1 A Sensor That Monitors The Temperature Of A Backyard Hot Tub Records The
Transcribed Image Text from this Question8.1 A sensor that monitors the temperature of a backyard hot tub records the data in a file named temp_data2.dat where each line in the file has the time of the reading followed by the temperature read. Read in this file (provided) and answer the following questions: (a) The temperature should never exceed 105°F. Use the find function to find the row numbers of the temperatures that exceed the maximum allowable temperature. (hint: seperate the data into time and temperature vectors) (b) Use the length function with the results from part (a) to determine how many times the maximum allowable temperature was exceeded. (c) Determine at what times the temperature exceeded the maximum allowable temperature, using the index numbers found in part (a). (d) The temperature should never be lower than 102°F. Use the find func- tion together with the length function to determine how many times the temperature was less than the minimum allowable temperature. (e) Determine at what times the temperature was less than the minimum allowable temperature. (f) Determine at what times the temperature was within the allowable limits (i.e., between 102°F and 105°F, inclusive). (g) Use the max function to determine the maximum temperature reached and the time at which it occurred. 1 | 2 %% Problem 8.1 3 % read the data from the file temp_data2.dat and create two vectors 4 % containing the times and the temperatures. 5 hot_tub_data = 6 time 7 temp 8 % a) elements_high should contain the temperature indexes from the temp vector 9 % where the temperature is high 10 elements_high = 11 % b) 12 high_count = 13 % c) 14 high_times = 15 % d) 16 low_count 17 % e) elements_low should contain the temperature indexes from the temp vector 18 % where the temperature is low 19 elements_low = 20 low_times = 21 % f) 22 allowable_times = 23 % g) use variables named max_temp and max_time for the maximum 24 % temperature and maximum time respectively 25 26
1- [4 Pts] Imagine That You Are An Application Developer. A New Version Of
Computer Science Assignment Writing ServiceTranscribed Image Text from this Question1- [4 pts] Imagine that you are an application developer. A new version of your operating system is released with several changes made to the transport layer protocols. Specifically, UDP has been removed completely but TCP was not changed. What specific changes must be made to your application to accomodate these changes? 2- [4 pts) Imagine that you are an application developer. A new version of your operating system is released with several changes made to the transport layer protocols. Specifically, the algorithm for TCP has been changed from Tahoe to Reno. What specific changes must be made to your application to accommodate these changes?
C COVID-19 Has Hit US Hard. All States And US Territories Are Reporting Total
C COVID-19 has hit US hard. All states and US territories are reporting total cases, new cases, total deaths, new deaths, and active cases. Create a program that will read in all states and US territories from a text file into an array using a function read each state’s data (a 55 by 4 array) from an example text file (see below) into a two-dimensional array using a function. calculate grand total of total cases, new cases, total deaths, and new deaths for all states using a function (or several functions). display each state’s statistical data and output to an output text file (I am not interested in your files, I am just interested in the programming part). Example text file includes: 130689 7671 4758 599 112565 41090 3585 1003 86 39995 15718 0 617 0 15032 15240 203 351 4 13989 14867 1857 512 35 14305 13324 974 236 15 12988 12980 1470 162 12 12742 12500 0 231 0 12259 11256 0 274 0 10932 7984 0 338 0 7022 7314 572 229 10 7054 7276 231 140 7 6461 5675 0 189 0 5436 4950 0 140 0 4770 4944 533 139 12 4791 4450 407 142 23 4308 4045 436 91 24 3770 3633 0 44 0 3294 2901 238 42 4 2773 2878 241 54 3 2822 2456 187 65 1 2371 2440 173 77 9 2361 2367 0 52 3 2303 2049 0 44 0 2005 1953 117 46 0 1871 1927 86 47 2 1860 1738 100 51 8 1687 1605 0 8 0 1586 1327 75 51 5 893 1101 0 10 0 1091 1097 99 24 2 815 1068 0 27 0 1041 986 51 30 1 486 955 0 45 0 604 946 78 25 3 853 922 0 25 0 887 854 17 16 0 741 845 98 25 3 820 673 0 14 0 588 669 0 9 0 513 624 0 12 0 558 543 31 23 1 520 499 29 10 0 331 409 46 8 0 401 371 0 4 0 282 345 21 4 1 341 299 1 6 0 261 288 48 4 0 193 225 18 3 0 148 210 10 0 0 158 185 0 6 0 164 112 0 4 0 85 8 0 1 0 7 513 38 21 1 488 42 0 1 0 7
6 – Consider The Figure Below Illustrating The Operation Of TCP Reno. How Can
Transcribed Image Text from this Question6 – Consider the figure below illustrating the operation of TCP Reno. How can you identify the following events by looking at the shape of the graph: a) [4 pts) when TCP slow start is operating, b) (4 pts) when TCP congestion avoidance is operating, c) [4 pts) a segment loss event due to a triple duplicate acknowledgment, d) (4 pts) a segment loss event due to a timeout, and c) [4 pts) the initial value of sshthresh? 45 40 35 30 25- Congestion window size (segments) 20- 15 10 5 0 o 0 2 4 6 8 10 12 14 16 18 20 22 24 26 Transmission round
Help Pleaseee! Mergesort Write A Template Function Called Mergesort That Sorts Its Array Parameter
Help pleaseee! Mergesort Write a template function called mergesort that sorts its array parameter using the mergesort algorithm. The function should have two parameters, an array of any type (a template variable), and an integer that records the size of the array. The function should return an integer that equals the number of times its barometer operation is executed. The mergesort function must be implemented iteratively and not recursively. You may (and should) write other functions that will be called by your mergesort function. Like quicksort you can find the barometer operation in the function called by mergesort, in this case, merge. Unlike quicksort, merge does not need to return a value so you may use its return value to return the count. ****this has to be a template function and cannot use vector at all ****there needs to be a count variable that counts the number of barometer operation (the operation that runs the most number of times). this is in C The parameter of the mergeSort function can only have what is mentioned on the question, you can use any number of helper functions with any parameters. thank you very much in advance
1. Explain How To Set Up User And Group Account In The Active Directory,
Transcribed Image Text from this Question1. Explain how to set up user and group account in the active directory, in addition, please explain how to have file and folders sharing. Please give examples. 2. List 3 situations that printers in a network needs to troubleshooting and how to fix or repair it. 3. Explain one situation how virtual memory might affect printing. 4. In a client-server based network, if the server is installed with Windows Server 2016, the workstations are installed with Windows 10, please explain 5 situations that might affect the network connectivity and also provide solution on how to fix it. 5. In Windows server-based networks, please explain at least 5 strategies on how to conduct data backup and data recovery. Give example. 6. Explain the following terms: Active Directory, Partition, Formatting, Multicasting and Multithreading. 7. Explain Window server-based networks, please draw a picture for each scenario. 8. Normally, what would be the minimum hardware requirements for installing Windows Server 2016? 9. What is the difference between dynamic addressing and static addressing? 10.As a network administrator, how do you enforce account policies and password policies to enhance the security in your system?
I Need Help With These Three Networking Questions: Thank You. Question 15 (1 Point)
I need help with these three networking questions: Thank you. Question 15 (1 point) Which statement is NOT correct about the “intra-AS” routing? Question 15 options: It performs routing among hosts and routers in the same AS routers in different AS can run different intra-domain routing protocols a gateway router has link(s) to router(s) in other AS’es gateways perform inter-domain routing Question 16 (1 point) Which option is an intra-AS routing protocol ? Question 16 options: RIP OSPF IGRP all of them Show transcribed image text
I Am In An Entry-level Java Class And Need Assistance Completing This Assignment. Any Help Is Appreciated! Thank You.
Transcribed Image Text from this QuestionNamed storage locations in memory, they must be declared before they can be used. The declaration specifies the type of data they can hold. Enter your answer here Q2.2 1 Point Values that are literally written into the program code. Enter your answer here Q3 Which of the following statements is NOT a true statement about Java variables? 2 Points O We must declare variables. We can assign a value to a variable before declaring it. O We can declare a variable and then assign a value to it. We can declare and assign a value to a variable simultaneously. Q4 Given the following function declaration, which statement is correct? 2 Points public static void amazing(int n, short m) { The function is named amazing, it accepts two arguments of type int and short, and returns a value of type static. O The function is named amazing, it accepts two arguments of type int and short, and does not return any value. O The function is named void amazing, it accepts one argument of type short, and it returns an argument of type int. The function is named void amazing, it accepts two argument of type int and short, and it returns an argument of type static Q5 Which of the following Java statements has a syntax error 2 Points O int x; O x= 1; while(x>3) { O Q6 Which of the following Java types cannot store the number 1000 2 Points O int O short O long O byte ———– Q7 Select the option that better reflects the type of the following numerical literal: 3.14159 2 Points int O long O char O double Q8 Select the correct statement 2 Points O HDDs and SSDs are both a type of non-volatile storage O HDDs and RAM are both a type of non-volatile storage medium O HDDs and RAM are both a type of volatile storage medium O SSDs and RAM are both a type of volatile storage medium Q9 The three stages of a program execution are 2 Points Olf, Do, While Test, Implement, Catch O Fetch, Decode, Execute O Lather, Rinse, Repeat Q10 Alan Turing is famous for: 2 Points O Being an actor that interpreted Benedict Cumberbatch in a movie O Proving that there are problems that cannot be solved by computers Proving that all problems can be solved by computers O Designing the enigma machine Q11 Java, Python, Minecraft, and Little Big Planet have something in common. They are Turing-complete. This means: 2 Points O Can do anything a Turing machine can do. O Are completely useless. O Were all invented by Alan Turing. Q12 Which of the following statements is true? 2 Points Array values are stored in contiguous memory locations. Array values cannot be changed after initialization. O Array indices start at 1. O Arrays can only hold integer numbers. Q13 Which of the following statements about recursive functions is NOT true. 2 Points O Recursive functions call themselves. Recursive functions have a limit on how many recursive calls can be made. O Recursive functions don’t need a base case. O Recursive functions work by abstracting a problem with a simpler version of the same problem. Q14 Select all valid variable names. (Valid means they will compile without error!) name class helloWorld my-name return Q15 What is the type of the variable? 6 Points short s = 2; byte b = 1; long 1 – 3; int i = 12; double d – 1.3; float f = 3.14; char c = ‘A’; String str = “Hello”; Q15.1 1 Point variable1 = str s b; Enter your answer here Q15.2 1 Point variable 2 = i L; Enter your answer here Q15.3 1 Point variable3 = sb; Enter your answer here Q15.4 1 Point variable4 = i*i; Enter your answer here Q15.5 1 Point – variable5 = d b*s; Enter your answer here Q15.6 1 Point variable6 = str d*L/its b; Enter your answer here Q16 Analyse the following code and answer the questions 5 Points int i = 21; boolean b = true; if (i > 21) i = i / 2; b = false; 1 elsc i = i % 2; b = true; } if (i % 2 = 0) { if (i >= 0) { i – -7; b = false; } } else if (b) i = (i * 5) – 1; else b = (1 % 2) != 0; } Q16.1 What is the value of variable i? 3 Points Enter your answer here Q16.2 What is the value of variable b? 2 Points Enter your answer here Q17 Reverse coding 8 Points analyse that code, you’ll see that all programs are printing “false”. For each question, you are allowed to change the value of 1 variable, but only one variable! The objective is to make the program print “true” For example int i = 0; int j = 0; boolean b = false; System.out.println( b ); If I change b to true, then the program will print true. So my answer would be: b – true; Q17.1 Write a single line of code, such that the program prints “true” 2 Points int i = 0; int ) – 0; boolean b = false; System.out.println(j !- i); Enter your answer here Q17.2 Write a single line of code, such that the program prints “true” 2 Points int i = 0; int j = 0; hoolean = false; System.out.println(j =- (i 1)); Enter your answer here Q17.3 Write a single line of code, such that the program prints “true” 2 Points int i = 0; int j = 0; boolean b = false; System.out.println( b
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more
Recent Comments