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
The gene form of a trait is called a(n) ​
Rom4ik [11]

Answer:

alleles

Explanation:

7 0
3 years ago
A tripod head can move vertically or horizontally. What term describes these movements?
AnnyKZ [126]

The term for vertical movement of a tripod is Tilt. The term for horizontal movement is Pan.

Vertical movement of the camera angle involves pointing the camera up and down. This sort of movement is achieved so as to follow a subject or show the top and bottom of a still object. With Tilt, you can show how tall objects are. On the other hand, the tripod’s horizontal movement is used for a smooth effect. Like Tilting, it shows a subject or show the distance from left to right between two objects. Pan shots are great for panoramic views .

7 0
4 years ago
Read 2 more answers
Which is a good plan for backing up data?
IgorC [24]
A good plan for backing up data is to setup an automatic backup to an external drive or cloud based storage on a regular basis.
6 0
4 years ago
Write a program that contains three methods:
Reil [10]

Answer:

#include <stdio.h>//defining header file

int max (int x, int y, int z) //defining a method max that hold three parameters

{

   if(x>=y && x>=z)//defining if block that checks x is greater then y and x is greater then z

   {

       return x;//return the value x

   }

   else if(y>z)//defining else if block it check y is greater then z

   {

       return y;//return the value y

   }

   else//else block

   {

       return z;//return the value z

   }

}

int min (int x, int y, int z) //defining a method max that holds three parameters

{

if(x<=y && x<=z) //defining if block that check x value is less then equal to y and less then equal to z

{

return x;//return the value of x

}

if(y<=x && y<=z) //defining if block that check y value is less then equal to x and less then equal to z

{

return y;//return the value of y

}

if(z<=x && z<=x)//defining if block that check z value is less then equal to x  

{

return z;//return the value of z

}

return x;//return the value of z  

}

int average (int x, int y, int z) //defining average method that take three parameters

{

int avg= (x+y+z)/3;//defining integer variable avg that calculate the average

return avg;//return avg value

}

int main()//defining main method

{

   int x,y,z;//defining integer variable

   printf("Enter first value: ");//print message

   scanf("%d",&x);//input value from the user end

   printf("Enter Second value: ");//print message

   scanf("%d",&y);//input value from the user end

   printf("Enter third value: ");//print message

   scanf("%d",&z);//input value from the user end

   printf("The maximum value is: %d\n", max(x,y,z));//calling the method max

   printf("The minimum value is: %d\n", min(x,y,z));//calling the method min

   printf("The average value is: %d\n", average(x,y,z));//calling the method average

   return 0;

}

Output:

Enter first value: 45

Enter Second value: 35

Enter third value: 10

The maximum value is: 45

The minimum value is: 10

The average value is: 30

Explanation:

In the above-given code, three methods "max, min, and average" is declared that holds three integer variable "x,y, and z" as a parameter and all the method work as their respective name.

  • In the max method, it uses a conditional statement to find the highest number among them.
  • In the min method, it also uses the conditional statement to find the minimum value from them.
  • In the average method, it defined an integer variable "avg" that holds the average value of the given parameter variable.
  • In the main method, three variable is defined that inputs the value from the user end and passes to the method and print its value.      
7 0
3 years ago
As you move through your professional career, you will receive requests for favors and contributions. You will not be able to ho
Alika [10]

Growing professionally comes with advises, comments (solicited and unsolicited), request for favours and also contributions. Moving up your professional career from the days of little beginning have always been accompanied with all of the requests and comments. As one levitates successfully, requests and contributions tend to increase. This can be scary and at the same time tiring as you go to question the sensibility of some of your decisions. While being inundated with these ’assistance', it is important that you carefully and thoroughly select the comments, contributions, requests of favours etc that is worth responding to. While some would be considered others will be discarded. Now, the question is how best can we politely turndown a person's request of favours and contributions without sounding rude, ungratetul and condescending. Both useful and irrelevant contributions deserve good responses. We could start by appreciating the request for favours and contributions, and tell whomsoever it may concern that you appreciate his/her assistance but unfortunately would not be needing them.

8 0
4 years ago
Other questions:
  • What field in an IPv4 packet is altered to prioritize video streaming traffic over web surfing traffic?
    11·1 answer
  • What might happen if a computer has too many applications running at one time?
    15·1 answer
  • In GIMP, the ( ) displays the image that the user is currently working on
    12·1 answer
  • When you move or size a control in the Form Designer, Visual Studio automatically adjusts the ________________ that specify the
    9·1 answer
  • You have a desktop computer that supports both IEEE 1394 and USB 2.0. You are purchasing some devices that will connect to these
    13·1 answer
  • In an IPv.4 addressing scheme the router works at layer 3 on which addressing layer?
    14·1 answer
  • Which of the following is the definition of registration authority ( RA)?
    10·1 answer
  • A social cause is: O A. when one person protests without the support of others. B. something that not many citizens think or car
    8·1 answer
  • How to run angular project from github.
    7·1 answer
  • Which of these would make text on a slide difficult to read?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!