Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter the number of bottles and cans:");
int numberOfbottles = in.nextInt();
int numberOfcans = in.nextInt();
System.out.printf("Bottles: %8d\n", numberOfbottles);
System.out.printf("Cans: %8d\n", numberOfcans);
}
}
Explanation:
Ask user to input the number of bottles and cans using Scanner class
Print the results so that the numbers to the right line up (Since we know that the numbers have at most 8 digits, we can use %8d in printf. Also, be aware that how printf statements are written so that the numbers line up)
Back them up on a different drive
Explanation:
The advantages of java.util.Stack are as following:-
- java.util.Stack is an implementation of the vector class hence it can keep track of position of elements in the stack hence it is not required to store an additional pointer for each node.
- In the implementation it allocates space only that much is needed.
These are the two advantages of java.util.Stack.
Answer:
The Layer 4 (Transport layer)
Explanation:
The transport layer is the fourth layer of the OSI (Open Systems Interconnection) model that is responsible for transmitting data between networking devices. Some of its other functions are;
i. It maintains flow control so that the destination station does not receive more packets than it can handle or process at a particular time.
ii. it also maintains error control so that the entire message (data) sent arrives at the layer without any error due to incompleteness, loss, damage or duplication.
<u>★ Defination:</u>
The number system or the numeral system is the system of naming or representing numbers. The number system helps to represent numbers in a small symbol set.
<u>★ Tips:</u>
The value of any digit in a number can be determined by:
• The digit
• Its position in the number
• The base of the number system
<u>★ Types of number system:</u>
There are various types of number system in mathematics. The four most common number system types are:
• Decimal number system (Base- 10)
• Binary number system (Base- 2)
• Octal number system (Base-8)
• Hexadecimal number system (Base- 16)