Answer:
turnRight and turnaround
Explanation:
The regular karel does not know these commands
ARPANET was the network that became the 'basis' for the Internet. It was based on a concept first published in 1967. It was developed under the direction of the U.S. Advanced Research Projects Agency (ARPA). In 1969, the idea became a modest reality with the interconnection of four university computers.
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:
Option (d) is the correct answer.
Explanation:
An Array is used to store multiple variables in the memory in the continuous memory allocation on which starting index value is starting from 0 and the last index value location is size-1.
In java programming language the array.length is used to tells the size of the array so when the user wants to get the value of the last element, he needs to print the value of (array.length-1) location so the correct statement for the java programming language is to print the last element in the array named ar is--
System.out.println(ar[ar.length-1]);
No option provides the above statement, so option d (None of these) is correct while the reason behind the other option is not correct is as follows--
- Option a will prints the size of the array.
- Option b also gives the error because length is an undeclared variable.
- Option c will give the error of array bound of an exception because it begs the value of the size+1 element of the array.