Answer:
Singleton pattern is the pattern for design that is build using the global variables which creates a lot of drawback in the designing. Singleton pattern are considered with the global variable and thus cannot be bound into single unit which complexes the components in design.
They have a loose coupled variables in design and also does not show the property of the multi-threading .These feature are responsible for the decrement in the performance and thus are not highly preferred choice for the pattern.So, it is known as the "anti- pattern".
Corrected or Complet Question
The ____ operator executes one of two expressions based on the results of a conditional expression.
a. .
b. ( )
c. ,
d. ?:
Answer:
(d) ? :
Explanation:
The ternary operator (? :) is an operator that executes one out of two expressions based on the results of a conditional expression. It is a faster or shorthand way of writing an if ... else statement. The operator checks the conditional expression and depending on whether it is true or false, one of its two statements will be executed. For example:
String correct = (4 < 5) ? "yes" : "no" ;
In the code above,
i. the conditional statement is (4 < 5) and this will be tested for to return true or false.
ii. the first expression (the one after the ?) is "yes" which will be executed if the conditional statement returns true.
iii. and the second expression (the one after the : ) is "no" which will be executed if the conditional statement returns false.
Therefore, since the conditional expression returns true for 4 < 5, the first expression will be executed. i.e "yes". This means that the String variable <em>correct </em> will have a value of "yes".
import java.util.Scanner;
public class JavaApplication86 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x = 0, c = 0, sum = 0;
while (true){
x = scan.nextInt();
System.out.println("You entered: "+x);
if (x == -1){
break;
}
sum += x;
c++;
}
System.out.println("The sum is "+sum);
System.out.println("You entered "+c +" numbers");
}
}
This works for me. Instead of subtracting one from c and adding one to sum, I used an if statement to break away from the while loop if the entered number is -1.
Answer:
Moderate.
Explanation:
A breach of security can be defined as any incident which results in an unauthorized access or privileges to a network, computer, software application, classified informations or data and services. There are three (3) levels of impact on an individual or organization when there's a breach of security; low, moderate and high.
A moderate level breach of security could cause a significant degradation in mission capability to an extent and duration that the organization is able to perform its primary functions, but the effectiveness of the functions is significantly reduced. It causes a serious adverse effect on individuals, employees or organizational assets and operations.
<em>However, in order to prevent a breach of security, it is advisable to use the following programs: firewall, demilitarized zone (DMZ), Intrusion Detection Systems (IDS) and Intrusion Prevention Systems (IPS) etc. </em>
C: Both
functions of cooling system is removing excess heat from the engine, maintaining the engine operating temperature and, bringing the engine up to the right operating temperature as quickly as possible.