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.
Answer:
class Phone(object):
def __init__(self, model, partNumber, retailPrice):
self.model = model
self.part_number = partNumber
self.retail_price = retailPrice
def phone_specs(self):
print( "Phone model: {}\nPart number: {}\nRetail price: {}".format( self.model, self.part_number, self.retail_price))
phone1 = Phone("Nokia", "asd234", 200.0)
phone1.phone_specs()
Explanation:
A class is a blueprint of a data structure used to create objects of the same data types and methods. The Phone class is an object that creates an instance of the phone1 object. The phone_specs method is used to display the details of the phone1 object.
Answer:
By supplying a variety of charts and graphs to present the information in best way.
By tracking and analyzing the data
By conveying large amount of numerical data in more understandable format.
Explanation:
You need to know the limitations of Excel software. You will find that it does not support more than 3 variables while analyzing. However, if you use analytic software like Tableau and Microsoft Power BI then you can use a lot number of variables. And this is done through graphs and charts, and the other variables apart from x, y, z are the colors, shades. etc. Even color alone can add a good number of variables, and hence you can understand. Thus, you will be able to query better. Queries become better if you have more variables. And charts and graphs always present the information in the best way/ Also you can track and analyze the data. And through it conveying a large amount of numerical data in a more understandable format is made possible, and this is definitely quite helpful. Hence, all of the options mentioned above are helpful. But they do not do complex calculations and complex queries in fact.
Answer: First Amendment
Explanation:
The First Amendment gives individuals the freedom of speech and the right to proactive any religion that they want. It also allows the people have a peaceful protest.
The swcud amendment gives people the right to keep arms. The Fourth hinders individuals from being searched without a warrant.
Therefore, the answer is First Amendment.
Answer: Operating system
Explanation:
The operating system is the type of software that are responsible for manage the processor time and also the memory allocation in the system. The operating system mainly deals with the processor time by scheduling the processor work done in the system.
The OS mainly control the system and then schedule the execution of various types of function by the central processing system (CPU). It also control the memory allocation in the system.