Answer:
Following are the program in python language
def prob3_6(k): #function definition
c = 0 #variable declaration
while k != 1: #iterating the while loop
print(k) #print k
if k % 2 == 0:#check if condition
k= k // 2 #divisible by 2
else: #else condition
k = k * 3 + 1
c = c + 1
print(k) #print k
print c #print count
prob3_6(3)#function call
Output:
3
10
5
16
8
4
2
1
7
Explanation:
Following are the description of program
- Create a function "prob3_6" in this function we passing an integer parameter of type "int" named "k".
- Inside that function we declared a variable "c" of type "int" that is used for counting purpose .
- After that we iterated the while for print the value of when it is not equal to 1 .
- We check if condition when k gives 0 on modulus then k is divisible by 2 otherwise else block will be executed in the else part we multiply by 3 to k and add 1 to the k variable .
- Finally print "k" and "c"
Answer:
Pixels
Explanation:
In computing the term pixels is actually a short for picture element. It refers to a single point (a dot) in an image. Computer monitors display images by dividing the screen into several pixels (dots) which are arranged in an x,y axis (rows and columns). The arrangement of the dots are so close to each other that they will appear as though the are connected.
It is important to note that on color monitors (which are by far the commonest), every pixel is made of three dots (red, blue and green) otherwise called the RBG all converging at same point.
Answer:
The answer is False
Explanation:
A comma is also called a statement terminator. A. True B. False
The answer is False
Comma is used to separate individiual values or data types
variables.
A semi-colon (;) at end of a statement is called terminator.
Answer:
Explanation:
The following code is written in Java. It is a method that takes in the two parameters as requested and checks whether or not the index exists in the array. If it does then it replaces the String in that Index with the new castMemberName String parameter that was given. If the replacement is successful then it returns a True boolean, if not then it returns a False boolean. The array being used must be named castNames and have a global scope to be accessible by the method since it is not passed as a parameter.
public static boolean replaceCastMember(int index, String castMemberName) {
System.out.println(castNames.size());
if (index <= castNames.size()) {
castNames.remove(index);
castNames.add(index, castMemberName);
return true;
} else {
return false;
}
}