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
Sloan [31]
3 years ago
12

In Java please.

Computers and Technology
1 answer:
Marizza181 [45]3 years ago
7 0

Answer:

See explaination

Explanation:

public class YearToAnimal {

static void yearToAnimalZodiac(int year){

String[] animals = {"Rat", "Ox", "Tiger", "Rabbit", "Dragon", "Snake", "Horse", "Goat", "Monkey", "Rooster", "Dog", "Pig"};

int baseYear = 2020;

int index = (year - baseYear) % 12;

// in case of negative index, change it to positive

if(index < 0)

index = 12 + index;

System.out.println(year + ": " + animals[index]);

}

// some test cases

public static void main(String[] args) {

yearToAnimalZodiac(2020);

yearToAnimalZodiac(2021);

yearToAnimalZodiac(2019);

yearToAnimalZodiac(2009);

yearToAnimalZodiac(2008);

yearToAnimalZodiac(2007);

}

}

You might be interested in
Nowadays, most online discussion boards are on Web-based forums that provide a variety of user-friendly tools to create and post
Katyanochek1 [597]

Answer:

The correct answer to the following question is option e.) Usenet.

Explanation:

Usenet - it  is a collection of the user-submitted messages or notes on the various subject that posted to the servers on the worldwide network. Each of the subject collection of notes is known as newsgroups. There are thousands of the newsgroups which is possible for us to form the new one.

It works like the decentralized computer network which allows us to download our required files. We can also download and access the binary files along with the text post.

5 0
4 years ago
What can you do to stop a computer from repeatedly restarting in a continuous loop?
abruzzese [7]
There are ways to break into the boot cycle of every machine, you could use one of them. Hold down modifier key[s] so that it boots differently or you may get a menu to select boot options.

A specific answer is OS/firmware dependent.
4 0
4 years ago
Fordham3 Hardware is known for its consensus buying center culture. Recognizing this corporate culture, someone attempting to se
balandron [24]

Answer: (c) focus exclusively on the head of the buying center.

Explanation:

As Fordham3 Hardware is known for its consensus buying center culture, so someone attempting to sell to Fordham3 should focus exclusively on the head of the buying center.

8 0
3 years ago
Innovation made from establishment of abucas to the present 5th
Minchanka [31]

Answer:

Douglas-fir, spruce, true fir, beech, and maple are toward the top of the list for oxygen release.Douglas-fir, spruce, true ...

4 0
3 years ago
Type the correct answer in the box. Spell all words correctly. What is the default margin width on all four sides of a document?
Sergeu [11.5K]

1 inch (2.54 cm

the default top and bottom margins were 1 inch (2.54 cm), but 1.25 inches (3.17 cm) were given at the left and the right.

That's standard for document size by default.

7 0
3 years ago
Other questions:
  • Each organization that provides host services on the public Internet is responsible for providing and maintaining DNS authoritat
    7·1 answer
  • One metric ton is approximately 2,205 pounds.
    6·1 answer
  • Use the _______ command to combine the selected cells and center them. merge across center across selection merge cells merge an
    7·1 answer
  • The Fibonacci numbers are the numbers
    15·1 answer
  • ____ is a utility that can verify that TCP/IP is installed, bound to the NIC, configured correctly, and communicating with the n
    11·1 answer
  • What is the purpose of the .NET Framework Class Library? a. it provides pre-written code that can be used by .NET applications b
    13·1 answer
  • What emphasizes extensive user involvement in the rapid and evolutionary construction of working prototypes of a system to accel
    15·1 answer
  • Can I use some Company's name in my Research Project. For example, my research is based on E-commerce security and i wanna use A
    14·1 answer
  • A computer essentially takes input, processes it, and produces output. Which person developed a machine in the mid-1880s that ac
    6·1 answer
  • Write the simplest statement that prints the following: 3 2 1 Go! python
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!