Questions
: Please write a MARIE program to calculate 1+2+3+...+100.

: Please write a MARIE program to calculate 1+2+3+...+100.

In: Computer Science

Loop and Function You are asked to develop a compensation calculator application for a department store....

Loop and Function

You are asked to develop a compensation calculator application for a department store. At the department store, the compensation of sales staff consists of a base salary and a commission. The base salary is $5,000, and the commission rate is tiered based on sales amount as following:

Sales Amount, commission rate
$0.01 – $5,000, 8%

$5,000.01 – $10,000, 10%

$10,000.01 and above, 12%

For example, if the sales amount is $12,000, the commission is calculated as following: commission = $5,000 * 8% +

($10,000 - $5,000) * 10% + ($12,000 - $10,000) * 12%. You can start with a few specific amounts first to help you figure out the general representation for commission calculation.

Requirements: (1) Define compute_commission function that computes the commission, using the above commission scheme. This function receives one parameter representing the sales amount and returns the corresponding commission.

(2) Define a print_commission function, which receives three parameters representing the beginning sales amount, sales increment, and ending sales amounts, and has no return. This function uses a for-loop to display a sales and commission table. For example, if the beginning sales amount is 10000, sales increment is 5000, and the ending sales amount is 100000, then this function will print out the following table:

Sales Amount | commission

10000 | 900.00
15000  | 1500.00

...

95000. | 11100.00

100000. | 11700.00
Note: this function must call the compute_commission function to determine the commission column.

(3) Next, define a target_sales function, which receives one parameter representing a desired salary and returns the corresponding sales amount that generates the desired salary. For example, if a staff’s desired salary is 30000 (which consists of base salary + commission), then this function will return a sales amount of 210834, which is the minimum sales amount that the staff must generate to earn the desired 30000 salaries. Note: this function must use a while-loop, and it must call the compute_commission function whenever you want to calculate the commission. In addition, it must start with an initial sales amount of $1 and increases the sales amount only by $1 in each iteration until it finds the sales amount needed to generate the desired salary.

(4) Define the main function, which will call the print_commission function to display a sales-commission table with 10000 as the beginning sales amount, 5000 as the sales increment, and 100000 as the ending sales amount. Then, ask users to enter their desired salary and use it as the argument to call the target_sales function. Lastly, display a message informing user the sales amount needed for the desired salary.

(5) Call the main function. Fix any syntax errors and test your code if you can.

In: Computer Science

In Java programing : Q1-A Deque supports operations, addFront(), addRear(), removeFront() and removeRear(). Given stacks and...

In Java programing :

Q1-A Deque supports operations, addFront(), addRear(), removeFront() and removeRear(). Given stacks and their push() and pop() operations only, what are the minimum number of stacks required for this implementation?

A-1, B-2, C-3, D-4,

Q2- True or false and why

The height of a random binary tree with 100 nodes can range from 7 to 100.?

Q3-One can convert a binary tree into its mirror image by swapping each node's left and right childern while traversing it in _______?.

Q4-How to calculate number of node by tree height ?

Q5-The complexity of using sequential search algorithm on a sorted list of n items is ____.

Q6-The data structure that allows deletions at both ends of the list but insertion at only one end is ________. < Which type ?

Q7-What will be the maximum number of comparisons needed with a binary search to find a particular customer's record from a sorted list of 100 records?

Q8-For an array containing 8 elements as: 42, 29, 75, 11, 65, 58, 60, 18, what will be the result of sorting it in ascending order using bubble sort after 2 passes have completed?

In: Computer Science

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