Answer: A) It is directly accessible only in B1
Explanation: In the given chunk of code, Class B1 is a base class. Class B2 is derived class of class B1. Class B3 is derived class of B2. As you can see class B1 has two members or instance variables i and j. Instance variable cannot be directly accessible by both B2 and B3. If you see this statement of the given code private int j; the keyword private is used with the variable j. This keyword is called access specifier. Access specifiers specifies how the members of a class can be accessed. These members are attributes and methods of that class. Any member of a class that are declared private cannot be inherited by derived classes of that class. Additionally these private members cannot be accessed from within any method inside derived class. So j is directly accessible only in B1. You can access a private instance variable from within the same class or can access it through the methods of class.
Answer:
The combined output will be option D which is
This porridge is too hot.
This porridge is just right!
Explanation:
As the complete question is not the given the complete question is found online and is attached herewith.
Now from the given attached code
As the temperature value is 180 which is more than 90 so the first loop is true and the first print out is
This porridge is too hot.
Now the temperature is cooled down using the formula such that the temperature reduced 100 degrees in the intervals of 20 now the temperature becomes 80. As it is greater than 70, thus the second if loop is not executed.
As the temperature is 80 this the next print out will be as
This porridge is just right!
So the combined output will be option D which is
This porridge is too hot.
This porridge is just right!
num = float(input("Enter a number: "))
num1 = int(num)
print(num - num1)
I hope this helps!
For count digits, you could just convert it to a String and check the length
Sum digits, convert to string then seperate each character with charAt then convert it to numbers in the return statement.
Average digits you can convert it to a String and then convert them back after taking them apart.
Answer:
» Microsoft word ( word processing )
» Microsoft powerpoint ( presentation )
» Microsoft access ( database mamagement )
» Microsoft excel ( spread sheets )
Explanation:
