Answer:
By given the right speech as much as the answers must be
Explanation:
By given the right speech as much as the answers must be
Answer:
strVar.replace(pos, n, str);
Explanation:
The strVar.replace() is a javascript function of searching and replacing a string for a defined value, whereby it finds and returns a new string where the defined values are replaced.
For example: to return a string where "Trump" is replaced with "Biden":
We have
var str = "Welcome Trump!";
var res = str.replace("Trump", "Biden", str);
Hence, in this case, the correct answer is strVar.replace(pos, n, str);
It is a (software) program that is installed on a computer without the user's knowledge for the purpose of making harmful changes. A computer virus attaches itself to another program (the execution of the host program triggers the action of the virus). And most of them perform actions that are malicious in nature, such as destroying data. A computer virus operates in two ways: As soon as it lands on a new computer, begins to replicate or it plays dead until the trigger kick starts the malicious code. The term 'computer virus' was formally defined by Fred Cohen in 1983.
Answer:
A computer virus is a virus attached onto your computer, and it gives you bugs and can often delete your important files.
Answer:
1.
if(y==0.3){ x = 100;}
2.
if(y == 10){
x = 0; }
else {
x = 1; }
3.
if(sales< 10000){
commission = 0.10;
}
else if(sales>= 10000 && sales <= 15000 ){
commission = 0.15;
}
else{
commission = 0.20;
}
Explanation:
The statements written in brackets represent the conditions while the statements in {...} represent the operation that would be executed depending on the outcome of the if statement.
For 1: if(y==0.3){ x = 100;}
If y is 0.3, 100 would be assigned to x
For 2:
if(y == 10){ x = 0; }
If y is 10, 0 would be assigned to x
else { x = 1; }
If otherwise, 1 would be assigned to x
For 3:
if(sales< 10000){commission = 0.10;}
Is sales is less than 10000, commission would be 0.10
else if(sales>= 10000 && sales <= 15000 ){commission = 0.15;}
If sales is within range of 10000-15000, commission would be 0.15
else{commission = 0.20;}
If otherwise, commission would be 0.20
Answer:
Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy algorithms are used for optimization problems. An optimization problem can be solved using Greedy if the problem has the following property: At every step, we can make a choice that looks best at the moment, and we get the optimal solution of the complete problem.
If a Greedy Algorithm can solve a problem, then it generally becomes the best method to solve that problem as the Greedy algorithms are in general more efficient than other techniques like Dynamic Programming. But Greedy algorithms cannot always be applied. For example, the Fractional Knapsack problem (See this) can be solved using Greedy, but 0-1 Knapsack cannot be solved using Greedy.
The following are some standard algorithms that are Greedy algorithms.
1) Kruskal’s Minimum Spanning Tree (MST): In Kruskal’s algorithm, we create an MST by picking edges one by one. The Greedy Choice is to pick the smallest weight edge that doesn’t cause a cycle in the MST constructed so far.
2) Prim’s Minimum Spanning Tree: In Prim’s algorithm also, we create an MST by picking edges one by one. We maintain two sets: a set of the vertices already included in MST and the set of the vertices not yet included. The Greedy Choice is to pick the smallest weight edge that connects the two sets.
3) Dijkstra’s Shortest Path: Dijkstra’s algorithm is very similar to Prim’s algorithm. The shortest-path tree is built up, edge by edge. We maintain two sets: a set of the vertices already included in the tree and the set of the vertices not yet included. The Greedy Choice is to pick the edge that connects the two sets and is on the smallest weight path from source to the set that contains not yet included vertices.
4) Huffman Coding: Huffman Coding is a loss-less compression technique. It assigns variable-length bit codes to different characters. The Greedy Choice is to assign the least bit length code to the most frequent character. The greedy algorithms are sometimes also used to get an approximation for Hard optimization problems. For example, the Traveling Salesman Problem is an NP-Hard problem. A Greedy choice for this problem is to pick the nearest unvisited city from the current city at every step. These solutions don’t always produce the best optimal solution but can be used to get an approximately optimal solution.
B. -2
C. "Open"
D. +2
Answer:
D. +2
Explanation:
The given function is an IF function where the first argument is a logical test, the second argument is the result if the logical test is true and the third argument is the result if the logical test is false. Depending on whether the result of the logical test is true or false, the respective value will be returned.
IF(logical_test, value_if_true, value_if_false)
In this case, the logical test first compares the value of B3 and D5. As B3 is not greater than D5, the result is false and the value for false will be returned. The value for false result of the logical test is equated by D5-B3 which is equal to 2. Thus the result of the IF function is +2.