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");
}
}
}
Answer:
usable capacity = 10 GB
Number of cylinders = 256
Block size = 4 KB
(1)Bytes in each cylinder = (10*230)/(256) = (10*222) = 40 MegaBytes
(2)Number of Blocks in each cylinder = (10*222)/(212) = 10K
(3)capacity of one track = 40 MegaBytes/(10*2) = 2 MB
Rotation speed = 3840 RPM
Number of rotations per second = 3840/60 = 64
Transfer rate = (2*64) = 128 MB/sec
Explanation:
Answer:
A
Explanation:
HTML is a coding language.
// Variable to keep track of array size
int length = 0;
// Array itself
int array[] = {};
// while loop will take input in the array until a negative number is entered
while(input>=0){
stdin = new Scanner(System.in);
array[length] = stdin;
length +=1;
}
// int variable to terminate while loop
int i =0;
// keep track of index of output array
int y =0;
while(arr[i] != length){
// making output array
int output[]={}; bool flag;
// put the element in out put array considering if it the desired one
output[y] = array [i];
// Now check if it was the desired?
for(int z=1;z<=length;z++){
if(array[i+z]!=output[y]){
flag = true;
}
else
{
output[y]=0;
y+=1;
}
if(array[i+z+1]=output[y] && flag == true){
output[y] = array[i];
y+=1;
}
}
//output the array
for(int o=0;o<y;o++)
System.out.println(output[o];
Warner Brother produced the Jazz Singer.