Answer:
Explanation:
The following program was written in Java. It creates a loop that asks the user for numbers. If it can convert it to an integer it accepts it and adds it to the sum variable otherwise it ouputs that it is not a valid number. Once all 10 integers are added it prints the Average of the values entered.
import java.util.ArrayList;
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int count = 0;
int sum = 0;
while (count != 10) {
System.out.println("Enter a number: ");
String answer = in.nextLine();
try {
int intAnswer = Integer.parseInt(answer);
sum += intAnswer;
count += 1;
} catch (NumberFormatException e) {
System.out.println("Not a valid number.");
}
}
int average = sum / count;
System.out.println("Average: " + average);
}
}
Answer:
The output of code is 20.
Explanation:
We need to give output of the following code:
numB = 25
while numB > 13:
numB = numB - 5
print(numB)
Solution:
We will check the condition of while loop, if the condition is true, then the statements inside the loop will be executed. Since brackets are not available so, only one statement is linked with while loop.
Executing the statements, we check condition while numB > 13 (25>13) is true, next statement will be executed numB = numB - 5 (20=25-13) so, when print(numB) will be executed, we will get 20.
The output of code is 20.
Answer:
White, the color value is 0xFFFFFF
Explanation:
Each segment is 8-bits, which totals to 255 in base-10 value, or 0xFF in hexadecimal.
11111111₂ == 255₁₀ == 0xFF₁₆
so
Red Green Blue
11111111 11111111 11111111
FF FF FF
When all 3 color values are turned on at max value (255), they produce white.
Answer:
Socialism is both an economic system and an ideology (in the non-pejorative sense of that term). A socialist economy features social rather than private ownership of the means of production.
Explanation: