Question: Java CHALLENGE ACTIVITY 6.3.3: Multi-branch if-else statement: Print century. Write an if-else statement with multiple branches. If given Year is 2101 or greater, print 'Distant
Java

CHALLENGE ACTIVITY 6.3.3: Multi-branch if-else statement: Print century. Write an if-else statement with multiple branches. If given Year is 2101 or greater, print 'Distant future" (without quotes). Else, if given Year is 2001 or greater (2001-2100), print "21st century". Else, if given Year is 1901 or greater (1901-2000), print "20th century". Else (1900 or earlier), print "Long ago". Do NOT end with newline. 1 test passed DIIDID All tests passed 240962.2339890.qx3zqy7 1 import java.util.Scanner; 2 3 public class YearChecker { 4 public static void main (String [] args) { 5 int given Year; 6 7 given Year = 1776; 8 9 \* Your solution goes here */ 10 11 } 12 } Run
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
