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.
Pizza. . . . . . . . . . .
Answer:
Answered below
Explanation:
//Program is written in Python programming //language.
number_of_trees = int(input ("Enter number of trees purchased: "))
height_of_trees = float(input("Enter height of trees: "))
delivery_status = input("Do you want trees delivered? enter yes or no ")
price_of_two_meters = 20
total_price = number_of_trees * price_of_two_meters
//Invoice
print (number_of_trees)
print(height_of_trees)
print (total_price)
print (delivery_status)
Hey there!
- The word "<u>verb</u>" simply means <em>'description of an action, assert, or event that is made into the main purpose of your predicate in your judgement' </em>
- Now that we have the definition of the word verb we can answer your question
- "<em>Has</em>" is past tense but it is THIRD person present
- "<em>Have</em>" is when you own something
<h2>Answer:
HAS ✅</h2>
BECAUSE "I SAW last night"
Note: usually people read the sentence to themselves until it makes easier sense to them or use context clues in the sentence to answer the particular question(s)
Good luck on your assignment and enjoy your day!
~LoveYourselfFirst:)
Answer:
B.O(1)
Explanation:
When we are implementing ADT stack using linked chain we can pop an entry from the stack having O(1) time complexity because in linked chain we have the head or top pointer in linked chain only.Popping and pushing in stack happens on only one end that is top.So we have move to move top in linked chain to the next and delete prev node.