Answer:
The program to this question can be given as:
Program:
factorial=1 #declare a variable.
number=int(input("Enter a positive integer:")) #input a number.
while (number>0): #loop
factorial= factorial*number # holding value in factorial variable
number=number-1
print('=',factorial) #print value.
Output:
Enter a positive integer:6
= 720
Explanation:
The description of the above python program can be given as:
- In the above program firstly we define a variable that is "factorial". In this variable, we assign a value that is 1 and it is used to calculate the factorial value.
- We define a variable "number". The number variable is used to take input from the user.
- Then we define a loop in the loop we calculate the factorial and hold the value in the factorial value in the last we print the value.
Answer:
a) Yes
b) Yes
c) Yes
d) No
e) Yes
f) No
Explanation:
a) All single-bit errors are caught by Cyclic Redundancy Check (CRC) and it produces 100 % of error detection.
b) All double-bit errors for any reasonably long message are caught by Cyclic Redundancy Check (CRC) during the transmission of 1024 bit. It also produces 100 % of error detection.
c) 5 isolated bit errors are not caught by Cyclic Redundancy Check (CRC) during the transmission of 1024 bit since CRC may not be able to catch all even numbers of isolated bit errors so it is not even.
It produces nearly 100 % of error detection.
d) All even numbers of isolated bit errors may not be caught by Cyclic Redundancy Check (CRC) during the transmission of 1024 bit. It also produces 100 % of error detection.
e) All burst errors with burst lengths less than or equal to 32 are caught by Cyclic Redundancy Check (CRC) during the transmission of 1024 bit. It also produces 100 % of error detection.
f) A burst error with burst length greater than 32 may not be caught by Cyclic Redundancy Check (CRC) during the transmission of 1024 bit.
Cyclic Redundancy Check (CRC) does not detect the length of error burst which is greater than or equal to r bits.
Answer:
A
Explanation:
The value will be the original stored in the int variables. This is because the method swap(int xp, int yp) accepts xp and yp parameters by value (They are passed by value and not by reference). Consider the implementation below:
public class Agbas {
public static void main(String[] args) {
int xp = 2;
int yp = xp;
swap(xp,yp); //will swap and print the same values
System.out.println(xp+", "+yp); // prints the original in values 2,2
int xp = 2;
int yp = 5;
swap(xp,yp); // will swap and print 5,2
System.out.println(xp+", "+yp); // prints the original in values 2,5
}
public static void swap(int xp, int yp){
int temp = xp;
xp = yp;
yp = temp;
System.out.println(xp+", "+yp);
}
}
Explanation:
I think it is 7, but I could be wrong..... sorry