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
Which of the given original work is protected by the copyright law
andreyandreev [35.5K]
BMW is my desion u cant copy write alot of things like books movies logos
7 0
3 years ago
Read 2 more answers
What two names are given to the blinking vertical line?
Paha777 [63]

Answer:

<u>see </u><u>below</u><u>:</u>

Explanation:

One is (the cursor).

Whenever you see a flashing vertical line called-the cursor--you can start typing.Note that the mouse pointer is also called a cursor,but it is shaped differently.The keyboard cursor is also called the insertion point.

5 0
3 years ago
Which of these is one of the primary concerns for protecting your family when online?
Lady_Fox [76]
Sharing personal information
7 0
3 years ago
Read 2 more answers
Write a program in Java programming language to display or calculate “Hello, Daddy and Mum”
olganol [36]

Answer:

class Simple{

public static void main(String args[]){

System.out.println("Hello Daddy and Mum);

}

}

Explanation:

First, we create a class, then a method and then give the Integrated Data Environment (IDE) the command to give out an output that says Hello, Daddy and Mum”

8 0
2 years ago
Explain the features of page layout software ​
BartSMP [9]

Answer:

Page Layout explains how the document pages are going to look like after printing. When we check the layout in Word, then we can see that the page layout covers the elements like margins, number of columns, option for editing the header and footers. Various types of layouts are like a magazine layout, static, adaptive, dynamic, and adaptive as well as responsive layout.

And these page layout techniques are being implemented for customizing the magazine appearance, books, newspapers, websites, and various other sorts of publications. And such page layout covers page's all elements. Some of the best page layout software are:

Microsoft Publishers

Scribus

Adobe InDesign

QuarkXpress

Xara

Download the free student version of Microsoft Office today, and explore Microsoft publisher to know more about it.

Explanation:

Please check the answer.

7 0
3 years ago
Other questions:
  • Every information systems (is) user has the right to a secure computing environment. this means that the
    12·1 answer
  • If using the md5 hashing algorithm, what is the length to which each message is padded?
    11·1 answer
  • Your task in this assignment is to exploit the race condition vulnerability in the above set-uid program. more specifically, you
    14·1 answer
  • The _____ feature automatically corrects typing, spelling, capitalization, or grammar errors as you type them.
    13·1 answer
  • Why is charles babbage known as father of computer?​
    10·1 answer
  • What is the difference between a rack and a tower?
    8·1 answer
  • Which network component blocks status?
    9·1 answer
  • Hi I need help with an assignment. We're learning about encryption and decryption in code.org. i need help with three of the tex
    14·1 answer
  • Can somebody hack ur account on Brainly bc I feel like I have bc I have answered waaaaaay more questions than shows on my profil
    13·1 answer
  • Which type of network consists of multiple Windows computers that share information, but no computer on the network serves as an
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!