Answer:
if speed < 0:
reverseDrivers +=1
elif speed < 1:
parkedDrivers +=1
elif speed < 40:
slowDrivers +=1
elif speed<=65:
safeDrivers +=1
else:
speeder +=1
Explanation:
The statements are written in python programming language
See a complete code screenshot attached, where all the variables are defined
Answer:
"public static void passAList(ArrayList<Integer> myList, int[] intArr)", is the correct answer for the above question.
Explanation:
Missing information :
- The option is missing but the question states "choose from the following". The correct defining syntax is defined above.
Detailed Explantion :
- The above question asked about syntax which takes the value of list and array as an argument.
- It is already defined in the above syntax.
- And the value is passed by the user at the time of function call.
- The array list is defined by the help of the ArrayList class and the array is defined by the help of the "[]" symbol.
Answer:
public class Pyramid {
public static void main(String[] args) {
int h = 7;
System.out.println("Pattern A");
for(int i = 1; i <= h; ++i)
{
for(int j = 1; j <= i; ++j) {
System.out.print("+");
}
System.out.println();
}
System.out.println();
System.out.println("Pattern B");
for (int i = 1; i<=h; ++i)
{
for(int j = h; j >=i; --j){
System.out.print("+");
}
System.out.println();
}
}
}
Explanation:
- The trick in this code is using a nested for loop
- The outer for loop runs from i = 0 to the heigth of the triangle (in this case 7)
- The inner for loop which prints the (+) sign runs from j = 0 to j<=i
- It prints the + using the print() function and not println()
- In the pattern B the loop is reversed to start from i = height
Answer:
The correct answer to the following question will be Option B (Policy).
Explanation:
- The Policy is a systematic set of rules for driving policies and obtaining rational results. It is a declaration of intent and is applied as a process or protocol.
- Policies are usually implemented by the governing body throughout the corporation.
- It was the feature of Information assurance management, which sought to dictate those activities throughout the organization via a collection of institutional requirements.
Therefore, Option B is the right answer.