Answer:
3) If number is zero, number is displayed;
Explanation:
The code snippet created is supposed to take any input number from the user (positive or negative) and print it to the console if it is less than 0. In this code the IF statement does not need an else clause and will work regardless. The System.out.println() statement does not need to be inside braces since it is a simple one line statement. Therefore, the only statement in the question that is actually true would be ...
3) If number is zero, number is displayed;
Answer:
If number is zero, number is displayed
Explanation:
Given
The above code segment
Required
What is true about the code segment
Analyzing the options, we have:
(1) Wrong statement because there is no else clause
The above statement is not a requirement for an if statement to be valid; i.e. an if statement can stand alone in a program
Hence, (1) is false
(2) The print statement must be in { }
There is only one statement (i.e. the print statement) after the if clause. Since the statement is just one, then the print statement does not have to be in {} to be valid.
Hence, (2) is false
(3) number is displayed, if input is 0
In the analysis of the program, we have: number <=0
i.e. the if statement is true for only inputs less than 0 or 0.
Hence, number will be printed and (3) is false
(4) number is displayed for positive inputs
The valid inputs have been explained in (3) above;
Hence, (4) is false.
(5) is also false
Answer: Character reference is the tool usually followed in the business world.It is defined as the recommendation that is provided by organization employee that has a relation with the candidate(individual) outside of the work. This also known as the personal reference. The candidate can be friend family or any other known person whose reference is being given.
This is used in the business field for revealing about the personality and character of the candidate apart from the skills and working abilities. It also helps in the hiring of the candidate easily when the description is good in the character reference.
Answer:
// here is program in Java.
// import package
import java.util.*;
// class definition
class Main
{
// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// variable
int gall;
double cost=0;
// object to read value from user
Scanner scr=new Scanner(System.in);
// ask user to enter type
System.out.print("Enter customer type (R for residential or B for business ):");
// read type of customer
char t=scr.next().charAt(0);
if(t=='r'||t=='R')
{
System.out.print("enter the number of gallons:");
//read number of gallons
gall=scr.nextInt();
// if number of gallons are less or equal to 6000
if(gall<=6000)
{
// calculate cost
cost=gall*0.007;
// print cost
System.out.println("total cost is: "+cost);
}
else
{
// calculate cost
cost=(6000*0.005)+((gall-6000)*0.007);
// print cost
System.out.println("total cost is: "+cost);
}
}
else if(t=='b'||t=='B')
{
System.out.print("enter the number of gallons:");
//read number of gallons
gall=scr.nextInt();
// if number of gallons are less or equal to 8000
if(gall<=8000)
{
// calculate cost
cost=gall*0.006;
// print cost
System.out.println("total cost is: "+cost);
}
else
{// calculate cost
cost=(8000*0.006)+((gall-8000)*0.008);
// print cost
System.out.println("total cost is: "+cost);
}
}
}catch(Exception ex){
return;}
}
}
Explanation:
Ask user to enter the type of customer and assign it to variable "t" with scanner object.If the customer type is business then read the number of gallons from user and assign it to variable "gall". Then calculate cost of gallons, if gallons are less or equal to 8000 then multiply it with 0.006.And if gallons are greater than 8000, cost for first 8000 will be multiply by 0.006 and for rest gallons multiply with 0.008.Similarly if customer type is residential then for first 6000 gallons cost will be multiply by 0.005 and for rest it will multiply by 0.007. Then print the cost.
Output:
Enter customer type (R for residential or B for business ):r
enter the number of gallons:8000
total cost is: 44.0
(ii). Detection is more important than prevention and recovery
(iii). Recovery is more important than prevention and detection
Answer:
(i) Prevention is more important than detection and recovery.
(ii) Detection is more important than prevention and recovery.
(iii) Recovery is more important than prevention and detection.
Explanation:
(i) Prevention is more important than detection and recovery.
Prevention of attack can be through various applications for example a walk through gates are placed in order to prevent any attacker from entering the premises and causing harm.
(ii) Detection is more important than prevention and recovery.
Detection of an attack can be done through for example a security alarm can detect an attack and inform others.
(iii) Recovery is more important than prevention and detection.
Recovery of an attack can be done by for example an insurance which will recover a portion of loss occurred during the attack.
Answer: A prevention
Explanation:
You can alway's prepare for someone by preventing from doing something but you can't detection something right away it is not h3cked and you can't recover something that is not detected
Answer:
The correct answer is 1000 MIPS.
Explanation:
Using the rule of three you can solve the needed cycles to complete 1.000.000 instructions.
1.000.000 instructions multiplied by 2 cycles, divided by 1 instruction is equal to 2.000.000 cycles to complete 1.000.000 instructions.
To find the MIPS you have to divide the frequency by the cycles needed to complete 1.000.000 instructions.
MIPS = 2GHZ / 2.000.000 cycles = 1000 MIPS.