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
Sholpan [36]
4 years ago
5

Write an if-else statement with multiple branches. If year is 2101 or later, print "Distant future" (without quotes). Otherwise,

if year is 2001 or greater, print "21st century". Otherwise, if year is 1901 or greater, print "20th century". Else (1900 or earlier), print "Long ago".
Computers and Technology
1 answer:
Yuki888 [10]4 years ago
7 0

Answer:

import java.util.Scanner;

public class Car {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a year");

       int year = in.nextInt();

       if(year<=1900){

           System.out.println("Long ago");

       }

       else if(year >=1901&& year < 2001){

           System.out.println("20th Century");

       }

       else if(year> 2001 && year<2101 ){

           System.out.println("21st Century");

       }

       else{

           System.out.println("Distant Future");

       }

   }

}

Explanation:

  • This is implemented in Java programming
  • First the Scanner class is used to receive user input for year and stored in the variable year
  • Using if...else statements, we start from year less that 1900 (Long ago), else if year is equal to or greater than 1901 but less that 2001 (20th century); else if year is between 2001 and 2101 (21st Century) Else (Distant future)
You might be interested in
Which of the following is an attack that adds SQL statements to input data for the purpose of sending commands to a database man
liq [111]

Answer: SQL Injection

Explanation:

The SQL injection is one of the type of attack which is used in the database management system for sending the commands by adding the structured query (SQL) language statement in the form of input data.

  • The SQL injection is the technique of code injection in which the SQL statement for the purpose of sending commands.  
  • It is widely used in the data driven applications.
  • The various types of web applications and web pages are used the SQL injection and uses in the form of input in the SQL query and then it is executed in the database.

Therefore, The SQL injection is the correct option.

5 0
3 years ago
How is a cell named?
bixtya [17]
Im guessing a cell is named by the scientist that found that cell in the fist place.
8 0
4 years ago
(3 marks)
muminat

Answer: 1.5 : 1

Explanation:

The average of 92 marks for the test is a weighted average of the proportion of students in the class.

Assume boys are in the proportion, x.

(90 * x) + (95 * (1 - x)) = 92

90x + 95 - 95x = 92

-5x = 92 - 95

-5x = -3

x = -3/-5

x = 0.6

Boys are 0.6 of the class

Girls are:

= 1 - 0.6

= 0.4

0.6 : 0.4

1.5 : 1

3 0
3 years ago
To set up a slide show you should do all of the following except ______.
Harlamova29_29 [7]
To set up a slide show you should do all of the following except exit without saving
5 0
4 years ago
________ is a condition in which information inflow exceeds an individual's processing capacity. Select one: a. Information over
In-s [12.5K]

Answer:

Option a is the correct answer.

Explanation:

  • The information overflow is a state where the coming information will be more in comparison with processing information.
  • For example, if there is limited space and any user has more luggage to keep on that space, then we can say that the luggage is overflow.
  • So when the information is more and the processing capacity is less then we can say it information overflow condition and it is also asked by the above question. Hence option a is the correct answer.
  • While the other is not because:- option b, c and d states some information statements which do not come in any information condition.
6 0
3 years ago
Other questions:
  • A spreadsheet has some values entered:Cell A1 contains 10 cell A2 contains, cell A3 contains 7. you enter in cell A4 the followi
    14·2 answers
  • Does magnifier count as assistive technology
    14·1 answer
  • 6 external computer parts that are input
    6·1 answer
  • How is a geometric constraint different from a numeric constraint?
    12·1 answer
  • Why should programmers use a Post Mortem Review?
    15·1 answer
  • In Microsoft word when you highlight existing text you want to replace , you're in?
    15·1 answer
  • A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the clie
    8·1 answer
  • Write a program that prompts the user for a name (any String value would work for testing), and print a hello message to the con
    5·1 answer
  • Say yes if you hate edge2021?
    8·2 answers
  • Where is the option to set Conditional Formatting rules found?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!