Java Homework (confusing )

I am really bad at java and 4I’m a beginner .

Can someone help me with my homework I am really stuck.

Here is what my teach wants:

Write a program that calculates and prints the number of minutes in a year (just do the calculation; no need for keyboard input). The purpose of this assignment is simply for you to demonstrate that you know how to multiply numbers using Java.

Make sure that your program is “doing the math” (minutes per hour * hours per day * days per year) and not just printing the final number.

I am thinking of just defining 3 int, ad plugging them in and multiplying them. For example:

int: minutes per hour
int hours per day
int days per year

then just multiplying them all together. Am I on the right track?

Looks like it, yes.

In JavaScript

const minutes_per_hour = 60;
const hours_per_day = 24;
const days_per_year = 365;

const minutes_per_year = () => {
    return minutes_per_hour * hours_per_day * days_per_year;
};
3 Likes