Answer:
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader brObject = new BufferedReader(new InputStreamReader(System.in));
String str;
while ((str = brObject.readLine()) != null) {
int number = Integer.parseInt(str);
System.out.println(number * number);
}
}
}
Explanation:
- Inside the main method, create an object of BufferedReader class to read lines from standard input.
- Declare a string and run a while loop until it reaches the end of the input.
- Inside the while loop convert the string into an integer data type.
- Finally display the output by squaring the number.
Answer:
struct PatientData{
int heightInches, weightPounds;
};
Explanation:
In order to declare the required struct in the question, you need to type the keyword <em>struct</em>, then the name of the struct - <em>PatientData</em>, <em>opening curly brace</em>, data members - <em>int heightInches, weightPounds;</em>, <em>closing curly brace</em> and <em>a semicolon</em> at the end.
Note that since the object - lunaLovegood, is declared in the main function, we do not need to declare it in the struct. However, if it was not declared in the main, then we would need to write <em>lunaLovegood</em> between the closing curly brace and the semicolon.
Answer:
The data transmission time will be 8 seconds (8.0s)
Explanation:
Using the formular:
T =A/S
T=Time = ?
Amount of Data = A = 2GByte
Speed = S = 2Gbps
The units of A and S are different
A is expressed in Bytes(B)
S is expressed in bits(b)
But :
1 Byte(B) = 8 bits(b)
T = A/S = 2GB/2Gb
since 1 Byte = 8 bits
T = 2 × G ×( B =8bits) / 2 × G × b
T = 2 × G × 8b / 2 × G × b
T = 2 × G × 8 × b / 2 × G × b
The common terms(2,G,b) cancel out
T = 8 seconds
Answer:
It is A: Packet metadata is used to route and reassemble information travelling through the internet.
Explanation:
Step 1: The Internet works by chopping data into chunks called packets. Each packet then moves through the network in a series of hops. Each packet hops to a local Internet service provider (ISP), a company that offers access to the network -- usually for a fee
Step 2: Entering the network
Each packet hops to a local Internet service provider (ISP), a company that offers access to the network -- usually for a fee.
Step 3: Taking flight
The next hop delivers the packet to a long-haul provider, one of the airlines of cyberspace that quickly carrying data across the world.
Step 4: BGP
These providers use the Border Gateway Protocol to find a route across the many individual networks that together form the Internet.
Step 5: Finding a route
This journey often takes several more hops, which are plotted out one by one as the data packet moves across the Internet.
Step 6: Bad information
For the system to work properly, the BGP information shared among routers cannot contain lies or errors that might cause a packet to go off track – or get lost altogether.
Last step: Arrival
The final hop takes a packet to the recipient, which reassembles all of the packets into a coherent message. A separate message goes back through the network confirming successful delivery.
/*
Since we have to check the first two options only as mentioned in last part of question the loop will work 2 times only and will compare the cost of first element and second and assign the healthoption accordingly
*/
for(int i =0;i<=1;i++){
if(annualCost[i]<annualCost[i+1]
best2 = healthOption[i]
else
best2 = healthOption[i+1]
}