1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mihalych1998 [28]
3 years ago
8

Write a program that inputs numbers and keeps a

Computers and Technology
1 answer:
rjkz [21]3 years ago
3 0

I've included my code in the picture below. Best of luck.

You might be interested in
If you find yourself boxed in by a vehicle on your left or right _____________
Zepler [3.9K]

Answer: A. speed up or slow down briefly

Explanation:

put that and then i saw someone said b and it was wrong and i got mad because it was the only answer i got wrong. but it’s a

4 0
3 years ago
Read 2 more answers
Write a program that prompts the user to enter two characters and display the corresponding major and year status. The first cha
nydimaria [60]

Answer:

  1. import java.util.Scanner;  
  2. public class Main {
  3.    public static void main(String[] args) {
  4.        Scanner input = new Scanner(System.in);
  5.        System.out.print("Please enter two characters: ");
  6.        String inputStr = input.nextLine();
  7.        if(inputStr.charAt(0) == 'B' || inputStr.charAt(0) == 'b'){
  8.            System.out.println("Biology");
  9.        }
  10.        else if(inputStr.charAt(0) == 'C' || inputStr.charAt(0)== 'c'){
  11.            System.out.println("Computer Science");
  12.        }
  13.        else if(inputStr.charAt(0) == 'I' || inputStr.charAt(0) == 'i')
  14.        {
  15.            System.out.println("Information Technology and Systems");
  16.        }
  17.        else{
  18.            System.out.println("Invalid major");
  19.        }
  20.        int num = Character.getNumericValue(inputStr.charAt(1));
  21.        if(num >= 1 && num <= 4){
  22.            switch (num){
  23.                case 1:
  24.                    System.out.println("freshman");
  25.                    break;
  26.                case 2:
  27.                    System.out.println("sophomore");
  28.                    break;
  29.                case 3:
  30.                    System.out.println("junior");
  31.                    break;
  32.                case 4:
  33.                    System.out.println("senior");
  34.                    break;
  35.            }
  36.        }
  37.        else{
  38.            System.out.println("Invalid year status");
  39.        }
  40.    }
  41. }

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.

4 0
3 years ago
Write a program that assigns values to
ss7ja [257]

Explanation:

10:A program that assigns the sum 20,30,40

20: input 20,30,40

30:sum input

40: print total

End

3 0
2 years ago
Which type of portfolio might a young investor who is not afraid of risk choose?
Keith_Richards [23]
i think it would be the investment with high risk and high return such as Stocks.When investing in stock, investor analyze whether a specific company will be doing well in the time of investment (which will increase the market price of the stock) and take a profit from it.
7 0
3 years ago
Based on your prior knowledge, match each civilization to the region it occupied.<br>​
zhannawk [14.2K]

Answer: Inca- South America

Aztec - Meso America

Explanation:

7 0
3 years ago
Other questions:
  • The Glow effect adds a blinking border around a chart.<br> t or f
    15·1 answer
  • Which cell has no nucleus ?​
    7·2 answers
  • What system of representation is used for the threaded portions
    12·1 answer
  • How many much memory is in one megabyte ?
    9·1 answer
  • Give me 3 facts and 3 opinions
    5·1 answer
  • Write a C program to calculate and display the coordinates of midpoint - M of a linesegment between two given points - say A and
    7·1 answer
  • What part of the meat help you identify the less tender cuts​
    13·1 answer
  • For this assignment your are to implement the Pet Class described in Programming Exercise 1, starting on page 494 in our textboo
    6·1 answer
  • What does FTTB mean?
    13·1 answer
  • Which of the following could be part of an algorithm?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!