Answer:
import java.util.Arrays;
public class swap{
public static void main(String []args){
int [] arr = {2,4};
swapValues(arr);
}
public static void swapValues(int[] values){
int temp;
System.out.println(Arrays.toString(values));
temp=values[0];
values[0]=values[1];
values[1] =temp;
System.out.println(Arrays.toString(values));
}
}
Explanation:
In the program above, we created the method swapValues that receives an array of integers as parameters. in the method definition, we created a temp variable that is used to swapp the element at index 0 and index 1. Java's Arrays.to string method is used to print the array before and after the swap.
Answer:
Circuit breaker
Explanation:
Circuit breaker -
It is a type of electrical switch , whose main function is to protect the electrical circuit by the process of short circuit or overloading , is referred to as a circuit breaker .
The circuit breaker , as the name suggests , disrupts the circuit as soon as there is the condition of overloading or short circuit , and thereby saves the appliances .
Hence , from the given information of the question,
The correct term is circuit breaker .
Answer: c. Depending on context the same sequence of bits may represent different types of information.
Explanation:
The options for the question are:
A. Computing devices use patterns of bits to represent complex information
B. Abstraction helps represent complex information by surfacing complexity that might otherwise be hidden
C. Depending on context the same sequence of bits may represent different types of information
D. Common abstractions that are represented by computing devices include numbers, characters, and color.
The following are true of how computers represent complex information:
• Computing devices use patterns of bits to represent complex information
• helps represent complex information by surfacing complexity that might otherwise be hidden
• Common abstractions that are represented by computing devices include numbers, characters, and color.
Therefore, the option that is not true of how computers represent complex information is that "depending on context the same sequence of bits may represent different types of information".
Answer:
Explanation:
Easy peasy lemon squeezy
print: ("hey how are you why are you what are you")
print: ("1,2,3:"):
eif: ("1"):
print: ("nothing")
eif: ("2"):
print: ("Well i am doing this")
eif: ("3):
print: ("watched pewdiepie")
Answer:
import random
def name_change( name: list ) -> list :
choice = random.choice( name )
choice_index = name.index( choice )
name.pop( choice_index )
return name
Explanation:
The python source code above makes use of the random package to select an item from a list in the function "name_change" and the index of that item is gotten fro the list and popped from the list "name", then the name is returned.
To call the function, assign it to a variable and add a list ( must be a list ) as its argument then print the result.