Explanation:
A. Pseudocode to determine the area of a triangle given value the base b andthe height h:-
START
INPUT b
INPUT h
COMPUTE Area = 0.5*b*h
DISPLAY Area
STOP
B. Pseudocode to compute the simple interest earned in 1 year given the starting account balance B and annual interest rate I :-
START
INPUT B
INPUT I
COMPUTE Interest = (B*I*1)/100
DISPLAY Interest
STOP
C. Pseudocode to determine the flying time between two cities given the mileage M between them and average speed of the airplane :-
START
INPUT M
INPUT S
COMPUTE Time = M/S
DISPLAY Time
STOP
Answer:
Null layout manager enables UI components to be placed at specified coordinates (x and y values).
Explanation:
Null layout is generally used by developers while creating demo UI or prototypes since the component location can be precisely specified in terms of x,y coordinates. This is also called absolute positioning.
However null layout suffers from a number of problems due to which it is normally avoided in production scenarios:
- Hardcoded coordinates and sizes are not portable across different environments ( different screen sizes,resolutions and font sizes).
- Null layout does not support preferred sizes for components. Component size cannot change with environment.
- User interface with null layout does not readjust automatically when the top level container is resized.
I think it's the first one. Hope this helps
Answer:
#include <iostream>
using namespace std;
void divide(int numerator, int denominator, int *quotient, int *remainder)
{
*quotient = (int)(numerator / denominator);
*remainder = numerator % denominator;
}
int main()
{
int num = 42, den = 5, quotient=0, remainder=0;
divide(num, den, "ient, &remainder);
return 0;
}
Explanation:
The exercise is for "Call by pointers". This technique is particularly useful when a variable needs to be changed by a function. In our case, the quotient and the remainder. The '&' is passing by address. Since the function is calling a pointer. We need to pass an address. This way, the function will alter the value at the address.
To sum up, in case we hadn't used pointers here, the quotient and remainder that we set to '0' would have remained zero because the function would've made copies of them, altered the copies and then DELETED the copies. When we pass by pointer, the computer goes inside the memory and changes it at the address. No new copies are made. And the value of the variable is updated.
Thanks! :)