Answer:
Once at the beginning of the loop, and then if the condition is true
Explanation:
- This is a general do-while loop.
- Minimum lifetime is 1 time and maximum lifetime is infinity.
- Firstly the code in the do bracket runs without any condition.
- The condition present in the while bracket tells the do bracket to run after the first time.
- If the condition is false the module ends.
- For while condition = true it sends the compiler back to do operation until the while condition becomes false.
Answer:
a) public class Bear extends Animal{
...
}
public class Zoo
{ private Animal[] myAnimals;
...
}
Explanation:
The question is an illustration of inheritance in Java programming language.
The syntax to follow is:
class subclass extends superclass {...}
From the question:
Bear subclass
Animal superclass
So, the following declaration will be used:
class Bear extends Animal{
...
}
Also from the question, the zoo object represents collection of many animals.
So, its declaration will follow:
class class-name{ ..... }
i.e.
class zoo{ .... }
The ... can then be replaced with declaration of each animal or an array to represent the declarations..
<em>Hence, (e) is correct</em>
Answer:
The answer is B (Flow Graph Analysis results)
Explanation:
Flow Graph Analysis results is a graphical representation of control flow which is process oriented, it shows all the paths through a program during its execution.
Answer:
The following are the algorithm to this question:
Explanation:
Following are the steps of the algorithm:
step 1:
To calculate the area of the room, firstly we need to divide the given image into parts and calculate the area of the given image.
step 2:
After calculating each part area, we merge all the parts to calculate the areas.
Calculating area of the parts:
In part 1:
It forms the square shape, and the formula of the square is .
In this diagram we let A=B. that's why the area is .
In part 2:
In this part also forms the square image. In this, the side is equal to (A-c). so, the area is equal to .
In part 3:
It forms the triangle shape, and the area of the triangle is. the value of "b" is E and the "h" is = (A-C). so, the area is .
The total area is: