Answer:
Aee explaination
Explanation:
#Implementation of shiftLeft method
#which shifts the bits in its input one
#place to tge left
def shiftLeft(bitstring):
bitstring = bitstring[1:]+bitstring[0]
#return as bit string format
return bitstring
#Get the input from user
bits = input("Enter a string of bits: ")
#call the shiftLeft method which returns the value
# that is stored in leftShift
leftShift = shiftLeft(bits)
#Display the output
print()
print(leftShift)
print()
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:
The correct option to the following question is option (B). e-business.
Explanation:
E-business is stands for the Electronic business.
E-business is the business which is conduct by the uses of the internet, Web, extranet or intranet, etc.
E-business is also known as the online business where online transactions take place.
E-business facilitates our customers that the selling and the buying of the goods between the consumers and the merchants.
Answer:
protecting email address privacy
Explanation:
for securing and privacy reasons and it is for the best
Answer:
The code to this question can be given as:
Code:
public class Book //define class.
{
private String title, author; //define variable.
Book(String a, String b) //define parameterized constructor.
{
title = a; //holding value.
author = b;
}
public String toString() //string function
{
return title + "\n" + author; //return value.
}
}
Explanation:
In the above java code firstly we declare the class book that name is already given in the question. Then we declare the private variable that datatype is string author and title. Then we declare the parameterized constructor. In the parameterized constructor we use the private variable for hold constructor parameter value. Then we declare the tostring() function in this function we return value of the title and author variable.