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
NISA [10]
3 years ago
13

Write a program that prompts the user to enter the minutes (e.g., 1 billion), and displays the number of years and days for the

minutes. For simplicity, assume a year has 365 days. Here is a sample run: Enter the number of minutes: 1000000000 1000000000 minutes is approximately 1902 years and 214 days
Computers and Technology
1 answer:
LenKa [72]3 years ago
4 0

Answer:

// here is code in java.

import java.util.*;

// class definition

class Solution

{

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // scanner object to read innput

       Scanner s=new Scanner(System.in);

        // variables

       long  min,years,days;

          long  temp;

          System.out.print("Please enter minutes:");

          // read minutes

          min=s.nextLong();

          // make a copy

temp=min;

 // calculate days

days=min/1440;

 // calculate years

years=days/365;

 // calculate remaining days after years

days=days%365;

 // print output

System.out.println(temp+" minutes is equal to "+years+" years and "+days+" days");

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read the number of minutes from user and assign it to variable "minutes" of long long int type.Make a copy of input minutes.Then calculate total days by dividing the input minutes with 1440, because there is 1440 minutes in a day.Then find the year by dividing days with 365.Then find the remaining days and print the output.

 Output:

 please enter the minutes:1000000000

 1000000000 minutes is equal to 1902 years and 214 days.

You might be interested in
What best determines whether a borrower's interest rate on an adjustable rato loan goes up or down?
Lelu [443]

Answer:

a bank finances

Explanation:

the best determines whether a borrower's investment on an adjustable-rate loan goes up or down is the current market. The market's condition drastically impacts the rate of investment.

8 0
3 years ago
Read 2 more answers
Which of the following is NOT one of the three basic structures used to solved logical problems?
Oliga [24]
I think module is not one of the theee basic structure
8 0
3 years ago
A collection of related instructions organized for a common purpose is referred to as
marshall27 [118]
Computer or data. Lol
5 0
3 years ago
Read 2 more answers
16. Budget Analysis Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop shoul
strojnjashka [21]

Answer:

import java.util.Scanner;

public class num8 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter month's budget");

       double monthBudget = in.nextDouble();

       double totalExpenses = 0.0;

       double n;

       do{

           System.out.println("Enter expenses Enter zero to stop");

           n = in.nextDouble();

           totalExpenses += n;

       }while(n>0);

       System.out.println("Total expenses is "+totalExpenses);

System.out.println("The amount over your budget is "+ Math.abs(monthBudget-totalExpenses));

   }

}

Explanation:

  • Using Java programming language
  • Prompt user for month's budget
  • Use Scanner class to receive and store the amount entered in a variable
  • Use a do while loop to continuously request user to enter amount of expenses
  • Use a variable totalExpenses to add up all the expenses inside the do while loop
  • Terminate the loop when user enters 0 as amount.
  • Subtract totalExpenses from monthBudget and display the difference as the amount over the budget

6 0
3 years ago
•What are some conflicts between humans and machines that have arisen in the past?
slamgirl [31]
I think that people have lost their jobs because of an increase of computers. Also, a<span>utomobiles can crash and injure and kill people. </span><span>Ships can be sunk. </span><span>Poorly constructed or maintained machinery can harm the workers. </span><span>The telegraph put the pony express out of business. </span><span>Many factories pollute the water and air. </span>
7 0
3 years ago
Other questions:
  • Which of the following is an example of a consumer service? computer builder motorcycle manufacturer cabinet maker air condition
    15·2 answers
  • A word object in an excel worksheet to activate the word features
    9·1 answer
  • Finish the statement below to correctly describe the Defense Enrollment Eligibility Reporting System (DEERS). DEERS is a central
    6·1 answer
  • Can someone that been helping me answer one more question for please and thx
    13·1 answer
  • Tribology is a branch of physics concerned with friction in mechanical motion. Knowledge of tribology would be useful working wi
    14·1 answer
  • 4. Write technical term for the following statements
    15·2 answers
  • Please help im not good at computer class ​
    10·2 answers
  • Please help me asapppp!​
    8·2 answers
  • Mario kart is mercedes lol
    13·2 answers
  • Which of the following tasks are suitable for creating an algorithm? Choose all that apply
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!