Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Else, if givenYear is 2001 or greater (2001-2100), print "21st century".

Answers

Answer 1
Answer:

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

Related Questions

What is the most important trait of the first pilot project in the AI Transformation Playbook?
If I have a 3 address machine, is my machine more likely to follow RISC or CISC design?2 addresses?1 address?0 address?
PLEASE HELP!!!For this activity, you will create two designs for the same project. For example, you might choose to create a CD cover for your favorite band’s newest release, or you might want to design a menu for the local deli. No matter what you decide for your subject matter, the two designs must involve different media. One of these media will be an image-editing program, such as Inkscape. You will learn more about the basic tools available in Inkscape later in this lesson. The two designs should incorporate different techniques. For example, you might make one design abstract, while making the other more realistic. Be sure to save both of your designs. Scan or take a picture of the design that wasn’t created in an image-editing program. You will submit this item later in this lesson as your portfolio item. Select the link to access the Techniques Activity Rubric.
Which statement must be included in a program in order touse a deque container?a. #include vectorb. #include c. #include containerd. #include deque
Which of the following protocols is used to unsure secure transmissions on port 443?A. HTTPSB. TelnetC. SFTPD. SHTTP

What is the main purpose of the status report? O A. To ensure that management and the team has a clear picture of the state of the project. B. To alert management to exceptional or unusual situations, C. To document the impact of change requests from the client. D. To detail the mistakes made in planning and budgeting,​

Answers

Answer:

A. To ensure that management and the team has a clear picture of the state of the project

Explanation:

hope this helps!

Answer:

A

Explanation:

Initialize a list. ACTIVITY Initialize the list short.names with strings 'Gus', Bob, and 'Ann'. Sample output for the given program Gus Bob Ann 1 short_names- Your solution goes here 2 # print names 4 print(short_names[0])

Answers

Answer:

shortNames = ['Gus', 'Bob','Zoe']

Explanation:

In this assignment, your knowledge of list is been tested. A list is data structure type in python that can hold different elements (items) of different type. The general syntax of a list is

listName = [item1, "item2", item3]

listName refers to the name of the list variable, this is followed by a pair of square brackets, inside the square brackets we have items separated by commas. This is a declaration and initialization of a list with some elements.

The complete python code snippet for this assignment is given below:

shortNames = ['Gus', 'Bob','Zoe']

print(shortNames[0])

print(shortNames[1])

print(shortNames[2])

Password is an example of an authentication mechanisms that is based on " what an entity has".True or false?

Answers

Answer:

False

Explanation:

A password in a one factor or multi-factor authentication is a mechanism not of what an entity has but what they know.

One factor authentication makes use of passwords only, to secure a user account. A multi-factor authentication uses two or more mechanisms for securing user accounts. It ask the question of what the users know (for password), what they have (security token, smart cards), and who they are(biometrics).

Answer:

False

Explanation:

The authentication mechanism especially the multi-factor authentication uses three types of authentication form factors.

i. What the entity knows: This includes what the entity knows and can always remember. Such as passwords and PINs

ii. What the entity has: This includes physical items that belong to the entity such as smart cards and token generators.

iii. What the entity really is: This includes natural or body features of the entity such as its thumbprint and its palm which can be used for verification.

According to these three factors, it is evident that password is based on "what an entity knows" and not "what an entity has".

Most networking media send data using _____ in which data is represented by only two discrete states: 0s and 1s.A. digital signals

B. contiguous signals

C. ramp signals

D. exponential signals

Answers

Answer: A) Digital signals

Explanation:

  • Digital signal is a signal that helps in describing about the data in sequential manner in form discrete bands or binary values.
  • The electrical signal containing data is converted into bits that can be represented through two digital values i.e. 0s and 1s.
  • Other options are incorrect because contiguous signal is regular adjacent signal. Ramp signal is represented as increment in magnitude with time
  • Exponential signal is based on sine and cosine signal that is two real time signal.
  • Thus, the correct option is option(A).

Answer:

i think digital signals

Explanation:

A digital signal is a signal that is being used to represent data as a sequence of discrete values; at any given time it can only take on one of a finite number of values.[1][2][3] This contrasts with an analog signal, which represents continuous values; at any given time it represents a real number within a continuous range of values.

Poor quality lateral communication will result in which ofthefollowing?
a. Lack of direction
b. Lack of coordination
c. Lack of delegation
d. Lack of control

Answers

Answer:

b. Lack of coordination

Explanation:

LAteral communication in human resources and organizational communication is known as the communication that exists between peers and colleagues, so that wouldn cause a lack of cirection, delegation or control because its not between bosses and employees, what it would cause would be a lack of coordination between the employees.

Answer:

b

Explanation:

b, lack of coordination

Once a device has failed, what metric measures the average amount of time to repair?a.
mean field replacement time (MFRT)
b.
mean time to repair (MTTR)
c.
mean time to restore (MTTR)
d.
mean restoration time (MRT)

Answers

Answer:b) Mean time to repair (MTTR)

Explanation:- Mean time to repair (MTTR) is the average time that is defined for the repairing of the of any failure or damage that has occurred.  Mean time to repair gives idea about the maintenance of the elements that can be repaired. It holds the responsibility of the reverting about the repair speed of the item. Therefore, the correct option is option(b).

Other Questions