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
qwelly [4]
3 years ago
7

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:
konstantin123 [22]3 years ago
4 0

Answer:

// here is code in c++.

// include headers

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

long long int minutes,years,days;

long long int s;

cout<<"please enter the minutes:";

 // read the minutes

cin>>minutes;

 // make a copy

s=minutes;

 // calculate days

days=minutes/1440;

 // calculate years

years=days/365;

 // calculate remaining days after years

days=days%365;

// print the result

cout<<s<<" minutes is equal to "<<years<<" years "<<days<<" days."<<endl;

return 0;

}

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 214 days.

You might be interested in
Monster Collector
Lera25 [3.4K]

Answer:

In java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 int monsternum, usernum;

 int count = 0;

 Random rand = new Random();

 String [] monsters = {"wild pikamoo","wild bulbaroar"};

 for(int i =0;i<2;i++){

     monsternum = rand.nextInt(5);  

     System.out.print("A "+monsters[i]+" appears! Guess a number between 1 and 5: ");

     usernum = input.nextInt();

     if(monsternum == usernum){      count++;      System.out.println("Congratulations, you caught a "+monsters[i]+"!");  }

 else{      System.out.println("You almost had it, but the monster escaped.");  }

 

 }

 System.out.println("There are no more monsters to encounter!");

 System.out.println("You caught "+count+" monsters of 2");

 if(count!=2){      System.out.print("Keep training to be the very best!");  }

 else{      System.out.print("You're the monster collector master!");  }

}

}

Explanation:

This declares monster and user number as integers

 int monsternum, usernum;

Initialize count to 0

 int count = 0;

Call the random object

 Random rand = new Random();

Create a string array to save the monster names

 String [] monsters = {"wild pikamoo","wild bulbaroar"};

Iterate for the 2 monsters

 for(int i =0;i<2;i++){

Generate a monster number

     monsternum = rand.nextInt(5);  

Prompt the user to take a guess

     System.out.print("A "+monsters[i]+" appears! Guess a number between 1 and 5: ");

Get user guess

     usernum = input.nextInt();

If monster number and user guess are equal, congratulate the user and increase count by 1

<em>      if(monsternum == usernum){      count++;      System.out.println("Congratulations, you caught a "+monsters[i]+"!");  } </em>

If otherwise, prompt the user to keep trying

<em>  else{      System.out.println("You almost had it, but the monster escaped.");  }  </em>

<em>  } </em>

Print no monsters again

 System.out.println("There are no more monsters to encounter!");

Print number of monsters caught

 System.out.println("You caught "+count+" monsters of 2");

Print user score

<em>  if(count!=2){      System.out.print("Keep training to be the very best!");  } </em>

<em>  else{      System.out.print("You're the monster collector master!");  } </em>

5 0
3 years ago
Online, it is easy to think of communication as “computer to ____________” rather than “_________ to ___________”.
KiRa [710]
I would say D but if not I’m terribly sorry

Hope this helps

Have a great day/night
7 0
3 years ago
Read 2 more answers
1. Science is the body of knowledge and methods produced by engineering.
olga nikolaevna [1]
True. Technology changes society
6 0
3 years ago
Natalie wants to create a database to collect information about sales transactions. She would like to use the database to look u
Tanya [424]

Answer:

the answer is a

Explanation:

7 0
4 years ago
Read 2 more answers
In a random digit telephone survey, homeless people or people with only cell phones do not have telephones that can be called wi
AURORKA [14]

Answer:

a. Undercoverage bias

Explanation:

Based on the information provided within the question it can be said that the bias being mentioned is Undercoverage bias. This refers to when a population of a sample are not being represented correctly, which in this scenario is because these people cannot be contacted. Therefore the correct bias that results from this is Undercoverage bias.

4 0
4 years ago
Other questions:
  • geoffrey is on location for a long shoot. he is worried that the battery power in his camera will not last. which source can he
    5·1 answer
  • What is a good project I can do for Artificial Intelligence? It has to be some type of Technology that covers Artificial Intelli
    14·1 answer
  • What is a hobbyist for engineering
    7·1 answer
  • The website of an international human rights organization stores a large database of information and provides search functionali
    15·1 answer
  • Michael is trying to remember his friend’s new cell phone number. He repeats it in his mind until he gets the new number entered
    8·2 answers
  • Tightly.
    5·1 answer
  • Sandi wants to check the average grades in her classroom. Which loop or algorithm should she use?
    8·1 answer
  • Ok who tryna play zombs royale
    7·1 answer
  • Declare a struct of your choice (Employee, Student etc). Delcare a node for singly link list. Declare an ADT of this linklist. T
    7·1 answer
  • Choose the term to complete the sentence.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!