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
miskamm [114]
2 years ago
15

Write a program that estimates how many years, months, weeks, days, and hours have gone by since Jan 1 1970 by calculations with

the number of seconds that have passed.
Computers and Technology
1 answer:
Rzqust [24]2 years ago
6 0

Answer:

Explanation:

The following code is written in Java. It uses the LocalDate import to get the number of seconds since the epoch (Jan 1, 1970) and then uses the ChronoUnit import class to transform those seconds into years, months, weeks days, and hours. Finally, printing out each value separately to the console. The output of the code can be seen in the attached picture below.

import java.time.LocalDate;

import java.time.temporal.ChronoUnit;

class Brainly {

   public static void main(String[] args) {

       LocalDate now = LocalDate.now();

       LocalDate epoch = LocalDate.ofEpochDay(0);

       System.out.println("Time since Jan 1 1970");

       System.out.println("Years: " + ChronoUnit.YEARS.between(epoch, now));

       System.out.println("Months: " + ChronoUnit.MONTHS.between(epoch, now));

       System.out.println("Weeks: " + ChronoUnit.WEEKS.between(epoch, now));

       System.out.println("Days: " + ChronoUnit.DAYS.between(epoch, now));

       System.out.println("Hours: " + (ChronoUnit.DAYS.between(epoch, now) * 24));    

   }

}

You might be interested in
What is an algorithm?
hichkok12 [17]
D. Both A and C. In my opinion though...
8 0
3 years ago
CAN SOMEONE DO OR LOOK UP THE PIE CHART FOR THIS ANSWER PLS AND I WILL MARK YOU BRAINLIEST BUT PLSSS HELP MEEEE!!!
beks73 [17]

Answer:

I highly recommened you use ggl charts.

Explanation:

It's free. ALL YOU NEED IS AN GGL ACCOUNT. You can also choose many types of graph you want.

4 0
2 years ago
What is the best back-end language to be used with React Native for NFC, WiFi, and Bluetooth Mobile app.?
Dmitriy789 [7]

Answer:

Node js

Explanation:

I would have use Python as it is more powerful and has a larger community. However, here we have to work with React Native, and hence lots of javascript will be involved. Hence, for this condition, we must go for Node Js, as its a similar technology, and suited for this kind of environment more. Python will certainly look odd out here. Hence, my preference for this condition will be Node.js.

7 0
3 years ago
Which of the following would be considered the highest risk portfolio?
sashaice [31]

The best option is (C) A portfolio made up of 60% stocks, 30% mutual funds, and 10% Treasury bonds.

There are a lot of risks involved when investing in almost anything. You may end up paying a lot for something that may not be worthwhile and at the end of it all end up losing a lot more than you get. In this case, more than half of the money has been invested in stocks and the prices of stocks change daily. Investing in stocks may give a good return but remains high risk to involve yourself in and should be avoided as much as possible.






4 0
3 years ago
What is the name of the file created after a successful compilation of myclass.java?
umka21 [38]
Myclass.class






---------------------------------
8 0
3 years ago
Other questions:
  • Laurence Sims owns a football team that plays its home games in City Stadium. To increase revenue, he is offering a sponsorship
    14·1 answer
  • Trish uas bought a new computer, which she plans to start working on aftwr a week. Since Trish has not used computers in the pas
    13·1 answer
  • In the game of economics, producers look to technological improvements to increase which of the following?
    7·2 answers
  • The disadvantage of this topology is that a problem with one node will crash the entire network.
    11·1 answer
  • Which of the following is true of information systems?
    15·1 answer
  • Use the drop-down menus to complete the steps to share a presentation through OneDrive.
    6·1 answer
  • Informed _________ will better manage complexities and enable more efficient manufacturing of goods.
    13·1 answer
  • How to use emojis on chromebook without on-screen keyboard
    14·1 answer
  • Screen reading for extended periods can cause___________ _____________, so the position the monitor to minimize glare and give y
    5·1 answer
  • Which statement best describes one reason why assembly language is easier
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!