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.
Explanation:
1 make sure only you know the password
2 having weak security on one browser is basically a doorway for someone to get into your network
Answer:
All the above options are correct.
Explanation:
In a Microsoft Word, to apply a left indent to a selected paragraph, a user can do any of the following:
1. Use the combination keys Ctrl+M on the keyboard to insert a left indent.
2. Use the mouse to pull the left indent marker on the ruler to create a left indent.
3. Another option is to go to the Paragraph dialogue box, place a positive value in the box labeled Left.
Hence, in this case, the correct answer is that: All the above options are correct.
Answer:
int switch_1,switch_2;
int get_first_switch_state()
{
return switch_1;
}
int get_second_switch_state()
{
return switch_1;
}
int get_lamp_state()
{
if((get_first_switch_state())
if(get_second_switch_state()) return 1;
else
if(!get_second_switch_state()) return 1;
return 0;
}
void toggle_first_switch()
{
if(get_first_switch_state()) switch_1=0;
else switch_1=1;
}
void toggle_second_switch()
{
if(get_second_switch_state()) switch_2=0;
else switch_2=1;
}
Explanation:
Answer:
couple.py
def couple(s1,s2):
newlist = []
for i in range(len(s1)):
newlist.append([s1[i],s2[i]])
return newlist
s1=[1,2,3]
s2=[4,5,6]
print(couple(s1,s2))
enum.py
def couple(s1,s2):
newlist = []
for i in range(len(s1)):
newlist.append([s1[i],s2[i]])
return newlist
def enumerate(s,start=0):
number_Array=[ i for i in range(start,start+len(s))]
return couple(number_Array,s)
s=[6,1,'a']
print(enumerate(s))
print(enumerate('five',5))
Explanation: