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
Int value[10] = {1, -7, 95, 123, 80, 67, -30, 17, 152, 121} ;
Lorico [155]

Answer:

<u>for loop code:</u>

int total=0;

for(int i=0;i<10;i++)

{

total + = value[i];

}

Explanation:

By declaration we know that the array is of size 10 which means the index will start from 0.

The variable name to be used to store the sum is given as total

We will initialize total with zero so that no garbage value is used.

For loop will be used to access the elements of array and calculate the sum. The syntax of for loop is given as:

for (initialization; condition; increment/decrement)

   {statement}

<u>Code:</u>

int total=0;

for(int i=0;i<10;i++)

{

total + = value[i];

}

8 0
3 years ago
These days, a digital signature is just as legitimate and trusted as an old-fashioned John Hancock on paper.
charle [14.2K]

Answer:

True

Explanation:

The reality is, wet signatures can easily be forged and tampered with, while electronic signatures have many layers of security and authentication built into them, along with court-admissible proof of transaction.

6 0
3 years ago
What are the 3 rules of music<br><br> ps: there is no music subject so i had to put something else
Kitty [74]

Answer:

Rules that apply to all situations and accasions in the music room

Explanation:

I hope this helps

7 0
3 years ago
Read 2 more answers
What allows people to create their own radio shows over the internet?
Alex787 [66]
Broadcasting sites, greater internet freedom,. 
6 0
3 years ago
What to do if you click on a phishing link on iphone
gregori [183]

Answer:

Nothing, just exit out of it

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Write the getNumGoodReviews method, which returns the number of good reviews for a given product name. A review is considered go
    14·1 answer
  • Which of the given original work is protected by the copyright law
    9·1 answer
  • "what type of index has an index key value that points to a data row, which contains the key value? "
    9·1 answer
  • Select one or more of the following: Which of these events will cause signal(s) to be generated by the kernel (the operating sys
    6·1 answer
  • In the Microsoft Excel spreadsheet how many choices are possible when using a single IF statement​
    9·1 answer
  • The foundation of secure communication on the internet replies on asymmetric encryption, with the use of Public and Private keys
    10·1 answer
  • In 1981, the first digital icons were launched for users in _________, which was the first computer with a GUI operating system.
    12·1 answer
  • Would you consider upgrading Maxine’s wardrobe a need or a want?
    11·1 answer
  • Vẽ sơ đồ DFD cho của hàng bán điện thoại ( Môn phân tích và thiết kế hệ thống thông tin)
    10·1 answer
  • a web server will utilize a directory protocol to enable users to authenticate with domain credentials. a certificate will be is
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!