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
tia_tia [17]
3 years ago
9

Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Els

e, if givenYear is 2001 or greater (2001-2100), print "21st century".
Computers and Technology
1 answer:
irga5000 [103]3 years ago
3 0

Answer:

import java.util.Scanner;

public class num9 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

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

       int givenYear =in.nextInt();

       if(givenYear>=2101){

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

       }

       else if(givenYear>=2001){

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

       }

   }

}

Explanation:

  • Using Java programming Language
  • Import Scanner class to receive user input of the variable givenYear
  • Use if statement to check the first condition if(givenYear>=2101)
  • Use else if statement to check the second condition if(givenYear>=2001)
  • print Distant future and 21st century respectively
You might be interested in
Give a real life of an if statement
bogdanovich [222]

Answer:

If Joe wants to eat an apple then he eats an apple.

Explanation:

The if statement checks if Joe "wants to eat an apple", if it turns out he does not then nothing will happen.

7 0
3 years ago
In Modern operating system, the __ feature has dramatically improved user productivity.
icang [17]

Multitasking, it allows you to do more than one thing at once.

3 0
3 years ago
Melissa is the network administrator for a small publishing company. as network administrator, she is in charge of maintaining t
Arte-miy333 [17]
The answer is an Intruder Prevention System (IPS). An Intrusion Detection System (IDS) will detect an attack but will not block it.
3 0
3 years ago
Under which key category do the Page Up and Page Down keys fall?
Fiesta28 [93]
They are called the navigation keys
7 0
4 years ago
Read 2 more answers
Im bored, any anime recommendations? i probably watched whatever youre gonna say
Alex777 [14]

Answer:

Hi..

Explanation:

i have seen a lot of anime shows XD hunter x hunter, dbz, black clover, 7 deadly sins

3 0
3 years ago
Read 2 more answers
Other questions:
  • Please helpp!! I need it quickly!
    6·1 answer
  • What element of a timeline helps to mark progress of the project?
    15·1 answer
  • Among the rights you have as a user of computing resources is the right to​ _______.
    12·2 answers
  • What are the different ways to represent compounds? Check all that apply. a structural formula a ball model a space-filling mode
    13·2 answers
  • kieran wants to search a database quickly for information on the last time a patient came to his medical facility.The informatio
    14·2 answers
  • PLEASE HELP ASAP!!! 99 POINTS FOR 3 MULTIPLE CHOICE QUESTIONS!!! PLEASE ANSWER ALL!!!
    8·1 answer
  • Java code?????
    12·1 answer
  • Problem: Mr. James Reid, the director of admissions at MOGCHS University, has
    14·1 answer
  • Clarice is an architect who is involved in design work on a restaurant in a building that used to be part of the city’s water wo
    8·1 answer
  • When software is purchased, a _____ is being bought that gives the purchaser the right to use the software under certain terms a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!