Questions
Would the following function work correctly if statically allocated activation records are used for implementation? Explain...

Would the following function work correctly if statically allocated activation records are used for implementation? Explain why it would work or not.

                   fun fact x = if x <= 0 then 1 else x * fact(x - 1);

In: Computer Science

C Program: (Knapsack Exhaustive): How do I add the 5 random generated values into the val...

C Program: (Knapsack Exhaustive): How do I add the 5 random generated values into the val [] arrays and how to add the total maximum weights ?

   // returns maximum of two integers
   int max(int a, int b) { return (a > b)? a : b; }
  
   // Returns the maximum value that can be put in a knapsack of capacity W
   int knapSackExhaustive(int W, int wt[], int val[], int n){
  

if (n == 0 || W == 0)
return 0;
  
// If weight of the nth item is more than Knapsack capacity W, then
// this item cannot be included
if (wt[n-1] > W)
return knapSackExhaustive(W, wt, val, n-1);

else return max( val[n-1] + knapSackExhaustive(W-wt[n-1], wt, val, n-1),
knapSackExhaustive(W, wt, val, n-1)
);

}
  

int main() {
  
  
int i;
time_t t;


//Intializes random number generator
srand((unsigned) time(&t));

// Print 5 random values from 3 to 15
int q;
printf("Five Random Values:\n");
for( i = 0 ; i < 5 ; i++ ) {
int q=printf(" %d\n",rand() % 15+2);
}
int val[]= {i};

   int j;
   //Print 5 random weights from 1 and 10000
   printf("Five Random Weights:\n");
for( j = 0 ; j < 5 ; j++ ) {
printf(" %d\n", rand() % 10000);
}

int wt[]={j};

  
int W = 10000;
int n = sizeof(val)/sizeof(val[0]);
n = sizeof(wt)/sizeof(wt[0]);
  
printf("Total Value: %d\t\n", knapSackExhaustive(W, wt, val, n));

printf("Total Weight:\t");

return 0;
}

In: Computer Science

Improve the algorithm by using two for loops instead of three, and analyze the running time...

Improve the algorithm by using two for loops instead of three, and analyze the running time of your improved algorithm asymptotically. Show the modified code.

Algorithm FactorSum(A, n)

Input: Array A of n real numbers.

S ← 0

for i ← 0 to n - 1

   for j ← i to n - 1

      P ← 1

      for k ← i to j

         P ← P x A[k]

S ← S + P

return S

In: Computer Science

You are in networking at a large international company. Your company recently decided to implement a...

You are in networking at a large international company. Your company recently decided to implement a cross-training initiative and you have been selected to give a presentation to an audience of non-networking professionals working at various departments in your company.

Your presentation must be clear and concise enough to convey technical information to professionals who have a limited understanding of how networking actually works. However, it must also be accurate enough that your audience can understand how their company roles (such as scheduling resource-hogging reports, allowing contractors access to the system, and setting the hours international customers can place orders on your company’s system) can impact the company’s network, particularly in terms of security.

You decide to use the OSI model to explain the fundamental characteristics and components of networks because it is visual and presents the complexity of network communication in 7 layers.

Draft your speaker notes to hand off to an assistant who will turn your notes into a graphic-rich presentation. Each of your answers should be about 150-250 words long.

Note: Your assignment is to draft speaker notes. Do not create a presentation and do not write a paper.

1. Overview of Networking and Security

You decide to begin your presentation by providing your audience an overview of networking, with an emphasis on security and why it is important for all company roles to assist in securing the company’s network.

Discuss the potential security risks for each layer of the OSI model and the risks in each of the following:

  • Distributed vs. centralized computer systems and why your department chose to be distributed/centralized
  • Different network topologies and why your department chose the topology it did
  • Why standards bodies are essential in networking and how your department complies with standards
  • The importance of communication protocols and which one(s) your department chose
  • The differences between LAN, WAN, and wireless technologies, and how your department incorporated each
  • The responsibilities associated with providing telecommunications services such as security, privacy, reliability, and performance

2. Routing and Switching

Describe basic routing and switching in the context of the OSI model (i.e., in which layer routing, switching, and cabling occur). To underscore your department’s commitment to achieving 24/7 availability, describe 3 strategies your department uses to ensure the availability of network access in switched and routed networks.

3. Effective Security Policy

Describe at least 3 characteristics of an effective security policy, emphasizing the ways in which all departments in the company are responsible for helping secure the company network.

4. Security Strategies

Explain strategies your department used to build security directly into the design of your company network.

5. Malware

Define malware in layperson-friendly language and identify at least 2 strategies your department has put into place to protect your company’s network against malware.

6. Closing

Summarize your presentation.

In: Computer Science

public static int example3 (int [] arr ) { int n = arr.length , total =...

public static int example3

(int [] arr ) {

int n = arr.length , total = 0;

for (int j = 0; j < n ; j += 2)

for (int k = 0; k <= j ; k ++)

total += arr [ j ]; return total ;

}

what is the running time of this method?

In: Computer Science

Create a program with the features: NEEDED IN C++. Keywords: has object, passing object 1) Implement...

Create a program with the features: NEEDED IN C++.

Keywords: has object, passing object

1) Implement a classnamed StarWars; Class StarWarshas a classnamed World;

2) The object starWarsOBJcreated the Class Moonas a tool that Darth Vader uses to control the Class World; Therefore, having the object worldOBJwithin your starWarsOBJ, pass the object moonOBJ as an argument to the worldOBJ;

3) The moonOBJhas a huge tower that is represented as the struct data_tower towercomprised of: int total_antennas,float *sending_signal, string message.

4) Create the method Inputasking the user what is the value for total_antennas, and then make the dynamic allocation of your array of float sending_signal[total_antennas], using the commands new and delete accordingly;

5) Run a simulation showing for each hour the sending_signal[total_antennas], is sending the string messagethat is printed on worldOBJthe following phrase, as ordered by Darth Vader: “... Darth Vader is the Great!...”. This message is repeated for each of the sending_signal[total_antennas], i.e. if you have 10 antennas, the message will be repeated 10 antennas x 24 hours a day; when printing the message, inform also what is the current time step in the simulator and which antenna is sending the signal.

In: Computer Science

What is a Test Case? Write the Test cases for a 4X4 queen’s problem.

What is a Test Case? Write the Test cases for a 4X4 queen’s problem.

In: Computer Science

State the advantages and disadvantages of using a virtual private network

State the advantages and disadvantages of using a virtual private network

In: Computer Science

Hand encode the following Micro Blaze instructions, give your answer in hexadecimal a) Use ADDI to...

  1. Hand encode the following Micro Blaze instructions, give your answer in hexadecimal

    a) Use ADDI to add the constant value $2AB3 from R6 and save the result to R7 b) Use the ADDC instruction to add the contents of registers R8 and R9, then save the sum in register R10 c) Use IMM and LWI to read a value from memory, starting with the base address $003B35A3, using an offset stored in R8, and having the value read into R9

In: Computer Science

Make a program to simulate the end of the world as we know, containing the following...

Make a program to simulate the end of the world as we know, containing the following features: NEEDED IN C++.

The world population according to all sci-fi movies will perish up to a certain percentage, given global: (a) earthquakes 10%, (b) tsunamis 20%, (c) volcanoes 10%, (d) freezing temperature from sudden ice age 10%, (e) crashing meteorites 10%, (f) widely spread fires 10%, (g) hunger 10%, (h) zombies 10%, and (i) hurricanes 10%;1) Implement a classnamed World; Class Worldinherited the Class CRandom;

2) In the Class Worldcreate methods named EarthQuakes; Tsunamis; Volcanoes; IceAge; Meteorites; Fires; Hunger; Zombies; and Hurricanes; Those methods are used to return/inform the death toll (in numbers and percentage) caused according to the respective event uniform probability: e.g. tsunamis rangeLow is 0 and rangeHigh is 20%;

3) The methods created in the previous step (item 2), should use the inherited Class CRandomto obtain the expected random probability;

4) In the Class World create a method named TotalSurvivorsthat informs in percentage what is the final earth's population that survived the Apocalypse/armageddon, compared with its current population currently estimated as 7 Billion;

5) In the Class World create a method named NewWorldthat will print the message: “Happy Ending! Total number of Survivors is: .... ”, if there is no survivors, then print the message: “No Happy Ending! There are no survivors.”

In: Computer Science

Write a C program without using if-else construct that does the following. It accepts a sequence...

Write a C program without using if-else construct that does the following. It accepts a sequence of positive integers between 1 and 9 both inclusive from the keyboard. The program will stop accepting input once an integer outside the range is entered. The program will finish by printing the total number multiples of 3 and total number of even integers entered. Test data and expected output: Enter integers between 1 & 9 both inclusive, outside range to stop Enter integer :0 Total no of even integer entered is 0 Total no of multiples of 3 entered is 0 Enter integers between 1 & 9 both inclusive, outside range to stop Enter integer :2 Enter integer :4 Enter integer :6 Enter integer :9 Enter integer :3 Enter integer :1 Enter integer :2 Enter integer :0 Total no of even integer entered is 4 Total no of multiples of 3 entered is 3

In: Computer Science

Explain why the reliability of a system is not static but dynamic.?

Explain why the reliability of a system is not static but dynamic.?

In: Computer Science

. Fibonacci sequence Fn is defined as follows: F1 = 1; F2 = 1; Fn =...

. Fibonacci sequence Fn is defined as follows: F1 = 1; F2 = 1; Fn = Fn−1 + Fn−2, ∀n ≥ 3. A pseudocode is given below which returns n’th number in the Fibonacci sequence. RecursiveFibonacci(n) 1 if n = 0 2 return 0 3 elseif n = 1 or n = 2 4 return 1 5 else 6 a = RecursiveFibonacci(n − 1) 7 b = RecursiveFibonacci(n − 2) 8 return a + b Derive the complexity of the above algorithm by writing the recurrence and solving it. Use the memoization idea (of dynamic programming) to obtain a linear time algorithm for the above problem. Show Pseudo-code and complexity proof. (5 + 10)

In: Computer Science

Create a method called firstLetter that takes a String parameter and integer parameter. It should return...

Create a method called firstLetter that takes a String parameter and integer parameter. It should return -1 if the number of words in the given String is greater than or equal to the integer parameter (it should return -1 and not process the String any further) (4 points). If the String does not have more words than the given integer, the method should return 1 if all the words in the string start with the same letter(8 points) and 0 if all the words do not start with the letter(4 points). (4 points: correct method signature-2 for parameter, 2 for return type) For example, System.out.println(firstLetter("Charlie chews chewy chews.",10)); would print to screen 1 since all words start with the same letter (notice the method is not case sensitive) and the number of words is less than 10.

code in java

In: Computer Science

Design a set of classes that keeps track of demographic information about a set of people,...

Design a set of classes that keeps track of demographic information about a set of people, such as age, nationality, occupation, income, and so on. Design each class to focus on a particular aspect of data collection. Assume the input data is coming from a text file. Create a main driver class to instantiate several of the classes.

In: Computer Science