Answer:
1. Database
2. Tree
<u>Database</u>
An organized collection of data, that is stored form different computer system is called Database.
<u>Tree Topology</u>
A type of network in which multiple computers are connected in a tree like structure. This type of network topology is used to organize data in database.
<u>Explanation</u>
In banks database servers are used to organize and store large volumes of financial data.
<em>To organize such type of data with the help increasing number of employs on database, tree topology is used to connect all computers of that bank on the network,</em>
Answer:
C. node*.
Explanation:
A linked list is a linear data structure where which contains elements stored at non contiguous memory location.They are linked to each other.Every node in a linked list is a pointer.Node consists of a data element and a pointer of node type which contains the address of the next node.
So to connect all the nodes we need the node to be a pointer.That's how we can connect them by address.
Answer:
- import java.util.Scanner;
- public class Main {
-
- public static void main(String[] args) {
-
- Scanner input = new Scanner(System.in);
- System.out.print("Please enter two characters: ");
- String inputStr = input.nextLine();
-
- if(inputStr.charAt(0) == 'B' || inputStr.charAt(0) == 'b'){
- System.out.println("Biology");
- }
- else if(inputStr.charAt(0) == 'C' || inputStr.charAt(0)== 'c'){
- System.out.println("Computer Science");
- }
- else if(inputStr.charAt(0) == 'I' || inputStr.charAt(0) == 'i')
- {
- System.out.println("Information Technology and Systems");
- }
- else{
- System.out.println("Invalid major");
- }
-
- int num = Character.getNumericValue(inputStr.charAt(1));
-
- if(num >= 1 && num <= 4){
- switch (num){
- case 1:
- System.out.println("freshman");
- break;
- case 2:
- System.out.println("sophomore");
- break;
- case 3:
- System.out.println("junior");
- break;
- case 4:
- System.out.println("senior");
- break;
- }
-
- }
- else{
- System.out.println("Invalid year status");
- }
-
- }
-
- }
Explanation:
The code consists of two main parts. The part 1 is to validate the input major and print out the major according to the input character (Line 10 -22). If the input character is not matched with the target letters, a message invalid major will be displayed.
The part 2 is to validate the year status to make sure it only fall within the range of 1-4 (Line 26 -45). If within the range, the program will display the year major accordingly. If not a message invalid year status will be displayed.