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]
4 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]4 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
write a recursive bool valued function containsvowel that accepts a string and returns true if the string contains a vowel
zhannawk [14.2K]

Answer:

Write a recursive, bool-valued function, containsVowel, that accepts a string and returns true if the string contains a vowel. A string contains a vowel if: The first character of the string is a v…

Explanation:

A:

bool containsVowel (string s) { bool hasVowel=false; if (s.length()==0) return false; else if (s[0]=='a'|| s[0]=='e'|| s[0]=='u'|| s[0]=='o'|| s[0]=='i'|| s[0]=='A'|| s[0]=='E'|| s[0]=='U'|| s[0]=='O'|| s[0]=='

7 0
3 years ago
"an excel spreadsheet is an example of a(n ________ database."
Sonja [21]
Sometimes it is hard for some people to say thank you and to rate 5 star when correct so i will you deserve it thanks for adding a correct answer! have a great day!! 
8 0
3 years ago
You are building a gaming computer and you want to install a dedicated graphics card that has a fast GPU and 4GB of memory on bo
Lilit [14]

Answer: PCI- Express?

Explanation:

if that is an answer....

7 0
4 years ago
A computer cannot store the data and information for your future use true or false​
baherus [9]
The answer would be false
8 0
3 years ago
Functions are used to _________
Black_prince [1.1K]

enable programmers to break down or demolish a problem into smaller chunks

5 0
2 years ago
Other questions:
  • I need help please?!!!!!!!!!
    15·1 answer
  • How to make a negative number positive in excel
    13·1 answer
  • A network using multiple cell towers falls under which type of network?
    13·1 answer
  • Proszę daje wszystko potrzebuje tego
    8·2 answers
  • When _______ wordart, you need to consider both the font size of the text and the size of the text box that contains wordart?
    15·1 answer
  • The _____________ RTN describes the overall effectof instructions on the programmer visible registers
    9·1 answer
  • which statement is true? O A Future games will be more context oriented. OB. Future games will be more product driven. Future ga
    13·2 answers
  • Discuss advantages and disadvantages of operating system
    8·2 answers
  • Can any software run on any processor
    5·1 answer
  • Write algorithm and flowchart for the following<br>a.find the sum and average of any four numbers ​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!