Add the following constants in the class definition, before the main method:
private final static float START_COST = 1.5f;
private final static float HIGH_TARIFF = 0.5f;
private final static float LOW_TARIFF = 0.25f;
private final static int FIXED_MINS = 2;
private final static int HIGH_TARIFF_MINS = 10;
Then add this to the main method you already had:
float price = START_COST;
if (x > FIXED_MINS) {
if (x <= HIGH_TARIFF_MINS) {
price += HIGH_TARIFF*(x-FIXED_MINS);
}
else {
price += HIGH_TARIFF*(HIGH_TARIFF_MINS-FIXED_MINS)
+ LOW_TARIFF*(x-HIGH_TARIFF_MINS);
}
}
System.out.printf("A %d minute call costs %.2f", x, price);
Answer:
Dennis Ritchie
C was originally developed at Bell Labs by Dennis Ritchie between 1972 and 1973 to make utilities running on Unix
It is false search engine are used for searching for something
Answer
The senders PC is using UDP protocol
Explanation
UDP is the User Datagram Protocol which is used as an alternative communication protocol to the TCP which is used primarily for establishing low latency and loss of tolerating connections between applications on the internet UDP is normally used by the programs running on different computers on a network. Its purposes is to send short messages which are datagrams. It is not much reliable because of its occasional loss of packet. Due to this packet loss the recipient is not guaranteed that the data being streamed will not get interrupted. This is because If a router on the Internet starts getting overloaded, or a packet gets corrupted due to interference or anything, the packet will be dropped unlike the TCP (Transmission control protocol)which resend the packets and keeps re sending. The UDP does not resend the packets which are dropped. Once they are dropped that all.