Answer:
This is a true statement.
Further Explanation:
The CPU is technically the brain of a computer, containing all the circuitry required to process input, store data, and output results.
Answer:
- public class Main {
-
- public static void main (String [] args) {
-
- for(int i = 1; i < 10; i++){
- int num = 0;
- num += i;
- }
- System.out.println(num);
- }
- }
Explanation:
In programming each variable has its scope. For example, a variable defined within the for loop has no longer exist outside the loop body. To illustrate this we can write a short program as presented above.
Firstly, create a for loop that traverse the number 1 - 10 (Line 5 - 8). Within the loop create a variable num and initialize it with zero (Line 6) and increment it with i value for each iteration (Line 7).
Outside the loop, we try to print the num (Line 9). When we run the program this will result in an error as the num which is declared inside the for loop will no longer exist outside the loop body.
Answer:
def scramble(s):
if len(s) % 2 == 1:
index = int(len(s)//2)
else:
index = int(len(s)/2)
return s[index:] + s[:index]
Explanation:
Create a function called scramble that takes one parameter, s
Check the length of the s using len function. If the length is odd, set the index as the floor of the length/2. Otherwise, set the index as length/2. Use index value to slice the s as two halves
Return the second half of the s and the second half of the s using slice notation (s[index:] represents the characters from half of the s to the end, s[:index] represents the characters from begining to the half of the s)
Answer:
For undirected graph n(n-1) for directed graph
Explanation:
The maximum number of edges for a undirected graph is given by , where n is number of vertices
The maximum number of edges in directed graph is given by , where n is number of vertices
The maximum number of edges is greater in undirected graph than directed graph
Poke hole with thin but strong object
Or buy new sharpener