Answer:
a.
Explanation:
Two bytes have 2 times 8 bits is 16 bits.
Max value that can be expressed is 2¹⁶-1 = 65535
Answer:
class Program {
public static void Main (string[] args) {
double number = 1.0;
while(number >= 0.001) {
Console.WriteLine (number);
number /= 2;
}
}
}
Explanation:
Always think carefully about what is in the condition of the while statement. In this case, you want the loop to be executed as long as the number is larger than or equal to 0.001.
The only thing that a computer actually understands is machine language. English-like constructs are gibberish to a computer, so they need to be translated by a compiler to machine language to run natively.
Digital vs Analog Audio is completely personal preference and there is no clear winner on which is better.
But there are some pros and cons about both, Analog sometimes distorts when playing and can be easily scratched and ruins the grooves. Analog is believed to be the true representation of the sound when it was recorded. Digital is not the actual recording of the sound, it's actually a combination of binary code. It is also sometimes mixed or remastered in Digital and sounds a bit different to make it sound better. It also depends on the system you are listening it from. You could have a horrible Digital system its playing through and an amazing Analog system playing, of course the Analog system will sound better in that case. Some believe that Digital is on par to overtake Analog in the "true picture of sound" category but some also say Analog will forever be the best at playing sound and Digital will always be the alternative.
But, in the end it's all personal preference and the pros and cons don't overweigh to make one better than the other.
Answer:
b) Bounded Waiting
Explanation:
int currentThread = 1;
bool thread1Access = true;
bool thread2Access = true;
thread1 { thread2 {
While (true) {
While (true)
{
while(thread2Access == true)
{
while(thread1Access == true)
{
If (currentThread == 2) {
If (currentThread == 1)
{
thread1Access = false; thread2Access = false;
While (currentThread == 2);
While (currentThread == 1);
thread1Access = true; thread2Access = true;
} }
/* start of critical section */ /* start of critical section */
currentThread = 2 currentThread = 1
… ...
/* end of critical section */ /* end of critical section */
thread1Access = false; thread2Access = false;
… ...
} }
} }
} }
It can be seen that in all the instances, both threads are programmed to share same resource at the same time, and hence this is the bounded waiting. For Mutual exclusion, two threads cannot share one resource at one time. They must share simultaneously. Also there should be no deadlock. For Progress each thread should have exclusive access to all the resources. Thus its definitely the not the Progress. And hence its Bounded waiting.