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.
The basic difference between RAM and ROM memory is RAM is read/write while ROM Is read-only.
Explanation:
- A ROM, non-volatile memory, does not use to store data, but RAM is volatile and requires power to store data.
- ROM is not given usually as a specification, but RAM is typically specified when buying a computer.
- We can write data only once in ROM. However, once it is written, we can read it any number of times. RAM is the main memory in a computer, and read from and write to it much faster than other storage types. RAM is used to store files in use on the computer.
Hence the basic difference between RAM and ROM memory is RAM is read/write while ROM Is read-only.
The answer will be google docs since it depends on a web and its an application. hope it helps
Answer:
The correct answer to the following question will be Option D (Media).
Explanation:
Media are the contact channels or devices used to store information or data and distribute it. The phrase refers to elements of the media marketing industry such as printed media, printing, mainstream media, film, theater, television and radio broadcast, and advertisement.
There are mainly three types of media, which are as follows:
- Print media
- Broadcast media
- Internet
Using these three media, we can describe the content and the surfaces on which an artist works.
Therefore, Option D is the right answer.
Answer:
SQL injection is a form of hacking that uses user input fields.
Explanation:
SQL injection is when a piece of code or entire algorithm is input where a program prompts for user input. They can be used to change or access data. To prevent this, a programmer should scrub inputs. Scrubbing data removes slashes and arrows, which or commonly used in code.