Answer:
Explanation:
The following is written in Java. It continues asking the user for inputs until they enter a -1. Then it saves all the values into an array and calculates the number of values entered, the highest, and lowest, and prints all the variables to the screen. The code was tested and the output can be seen in the attached image below.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int count = 0;
int highest, lowest;
ArrayList<Integer> myArr = new ArrayList<>();
while (true) {
System.out.println("Enter a number [0-10] or -1 to exit");
int num = in.nextInt();
if (num != -1) {
if ((num >= 0) && (num <= 10)) {
count+= 1;
myArr.add(num);
} else {
System.out.println("Wrong Value");
}
} else {
break;
}
}
if (myArr.size() > 3) {
highest = myArr.get(0);
lowest = myArr.get(0);
for (int x: myArr) {
if (x > highest) {
highest = x;
}
if (x < lowest) {
lowest = x;
}
}
System.out.println("Number of Elements: " + count);
System.out.println("Highest: " + highest);
System.out.println("Lowest : " + lowest);
} else {
System.out.println("Number of Elements: " + count);
System.out.println("No Highest or Lowest Elements");
}
}
}
The organization or agency would assist the fire department with incident scene security, crowd control, and explosives disposal is law <u>enforcement</u>.
<h3>What is Law enforcement?</h3>
Law enforcement is said to be activity of a given members of government and they are said to often act in an organized manner to enforce law by knowing , deterring people who violate the rules and regulations that are governing that society.
hence, The organization or agency would assist the fire department with incident scene security, crowd control, and explosives disposal is law <u>enforcement</u>.
Learn more about law enforcement from
brainly.com/question/21082629
#SPJ1
Answer:
Mac Address
Explanation:
The MAC address or Media Access Control is a unique identifier that each manufacturer assigns to their devices that can connect to the network. They consist of 48 bits in hexadecimal form, grouped into 12 pairs of characters and each character is formed by four binary numbers, generally separated by a colon. MAC addresses are used in the data link layer of the OSI model, specifically in the lower Medium Access Control layer. An example of a MAC address could be:
10: 68: c5: 5e: 27: 3f.
Answer:
int calculate_cost(int quantity) {
double cost = 0;
if (quantity <= 20)
cost = quantity * 23.45;
else if (quantity >= 21 && quantity <= 100)
cost = quantity * 21.11;
else if (quantity > 100)
cost = quantity * 18.75;
return cost;
}
Explanation:
Create a function called calculate_cost that takes one parameter, quantity
Initialize the cost as 0
Check the quantity using if else structure. Depending on the quantity passed, calculate the cost. For example, if the quantity is 10, the cost will be $234.5
Return the cost