Answer:
Explanation:
The following code is written in Java and runs a thread every 45 seconds that adds the two counters together and saves them in an integer variable called register. Then prints the variable. If this code runs 5 times it automatically breaks the loop. This can be changed or removed by removing the breakLoopCounter variable.
public static void add_Counters(int counterOne, int counterTwo) {
int register = 0;
int breakLoopCounter = 0;
try {
while (true) {
register += counterOne + counterTwo;
System.out.println(register);
Thread.sleep(45000);
breakLoopCounter += 1;
if (breakLoopCounter == 5) {
break;
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
You can just look up "python ide online" on google and paste this code:
n = -1
count = 0
while n < 0:
n = int(input("We're checking to see if a number is prime or not! Enter a positive number: "))
if n % 2 == 0:
if n == 2:
print("{} is a prime number".format(n))
else:
print("{} is not a prime number".format(n))
else:
for x in range(n, 1, -1):
if n % x == 0:
count += 1
if count > 1 or n == 1:
print("{} is not a prime number".format(n))
else:
print("{} is a prime number".format(n))
I've written some code that checks to see if a number entered by the user is a prime number or not.
Sorry, but I'm not too good with pseudocode plans and all that. I hope this helps.
Answer:
Check the explanation
Explanation:
<em>Cube.m:</em>
mass = input("Enter the mass of cube [kilograms]: ");
if(mass<=0)
disp("Error: Mass must be greater than zero grams")
else
fprintf("The length of one side of cube is %.2f inches",2.7*mass);
end
<em>Output1</em>
octave:2> source ( Cube.m Enter the mass of cube [kilograms]: octave:2>-3 Error: Mass must be greater than zero grams
<em />
Answer:
umm I think it's C it's between that one and d so the 1st and 4th but leaning more towards C
Answer:
The computer will follow the steps, but the program might not work.
Explanation: