Answer:
Occurs when a specific language construct was expected, but something else was provided.
The standard (and default) port for HTTP<span> servers to listen on is 80, though they can use any port. </span>HTTP<span> is based on the </span>TCP/IP protocols<span>, and is used commonly on the Internet for transmitting web-pages from servers to browsers.</span>
Answer:
False
Explanation:
<em>The complexity of the hash, which is the hexadecimal number produced by the hashing process, determines the precise length of time required for block production. Thus, block times won't always be the same.</em>
The answer is a) It improves upon the two-phased commit by requiring that locks be acquired at the start of a transaction.
Reason: The 3PC is an extension or you can say developed from 2PC that avoids blocking of an operation. It just ensures that first n sites have intended to commit a transaction that means it acquires commits or locks before the start of any transaction to avoid any blocking.
Option b) is wrong as it does not allow coordination, it just let all the other sites do their transaction if any other site is blocked, so no coordination is there between sites that they will wait till their coordinator is corrected.
Option c) is wrong as lock operations are shared between other connections as when their coordinator fails, the new coordinator agrees to the old coordinator that they had shared locks before and they can start their transaction.
Option d) is wrong as option a) is correct.
If you like the answer, please upvote.
Answer:
import java.util.*;
public class Main {
public static void main(String[] args)
{
Scanner scan = new Scanner();
double budget=0, num=0, total=0;
System.out.println("Your budget for the month? ");
budget=scan.nextDouble();
System.out.println("enter all expense, and after that type -9999 to quit: ");
while(num != -9999)
{
total+=num;
num=scan.nextDouble();
}
if(total<=budget)
{
System.out.println("under budget by ");
System.out.println(budget-total);
}
else
{
System.out.println("over budget by ");
System.out.println(total-budget);
}
}
}
Explanation:
- Take the budget as an input from user and store it to the budget variable.
- Loop until user has entered all his expenses and keep on adding them to the total variable.
- Check If the total is less than or equal to budget or otherwise, and then print the relevant message accordingly.