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
Create a SavingsAccount class. Use a static data member annualInterestRate to store the annual interest rate for each of the sav
andrew-mc [135]

Answer:

see explaination

Explanation:

SavingsAccount.h

#pragma once

#ifndef SAVINGS_H

#define SAVINGS_H

//SavingsAccount class declaration

class SavingsAccount

{

//declare data members

private:

//set annualInterestRate to 0.0 default value

static double annualInterestRate;

double savingsBalance;

public:

//set the balance

void setBalance(double);

//modify interest rates

static void modifyInterestRate(double);

//retruns total balance with interest

double calculateMonthInt();

};

#endif

SavingsAccount.cpp

//include required header files

#include<iostream>

#include"SavingsAccount.h"

using namespace std;

//set the annualInterestRate to 0

double SavingsAccount::annualInterestRate = 0;

//static funtion modify interest rate

void SavingsAccount::modifyInterestRate(double iRate)

{

annualInterestRate = iRate;

}

//set the balance

void SavingsAccount::setBalance(double bal)

{

savingsBalance = bal;

}

//calculating savings balance with monthly interest

double SavingsAccount::calculateMonthInt()

{

double monthInt = 0;

monthInt += savingsBalance*annualInterestRate / 12;

return savingsBalance += monthInt;

}

DriverProgram.cpp

//include required header files

#include<iostream>

#include "SavingsAccount.h"

using namespace std;

//main methods

int main()

{

//delcare class objects

SavingsAccount saver1, saver2;

//setter functions of balance

saver1.setBalance(2000.00);

saver2.setBalance(3000.00);

//Setting annual interset 0.03 to static variable

saver1.modifyInterestRate(0.03);

//finding the balance in saver1 and saver2 account

cout << "Balance of saver1 and saver2 on 3% interest Rate\n";

cout << "--------------------------------------------------\n";

cout << "Balance of saver1 = " << saver1.calculateMonthInt()

<< endl;

cout << "Balance of saver2 = " << saver2.calculateMonthInt()

<< endl << endl;

//Setting annual interset 0.04 to static variable

saver1.modifyInterestRate(0.04);

cout << "Balance of saver1 and saver2 on 4% interest Rate\n";

cout << "---------------------------------------------------\n";

cout << "New Balance of saver1 = " << saver1.calculateMonthInt() << endl;

cout << "New Balance of saver2 = " << saver2.calculateMonthInt() << endl<<endl;

return 0;

}

4 0
3 years ago
This program will output a right triangle based on user specified height triangle_height and symbol triangle_char. (1) The given
Arturiano [62]

Answer:

See explaination

Explanation:

triangle_char = input('Enter a character:\n')

triangle_height = int(input('Enter triangle height:\n'))

print('')

for i in range(triangle_height):

for j in range(i+1):

print(triangle_char, end = " ")

print()

4 0
3 years ago
_________ is a protocol used by e-mail clients to download e-mails to your computer. (
s2008m [1.1K]
I would say d.pop.

Hope this helps !

Photon
5 0
3 years ago
A hub transmits all incoming messages to all of its ports except the port where the messages came in. A switch usually sends mes
leonid [27]

Answer:

MAC Addresses (Destination and Source MAC address)

Explanation:

A switch has 3 primary functions:

  • Forward frames
  • Learn addresses
  • Avoid loops

An Ethernet frame has the header, data and trailer and there are two specific fields in the header that helps the switch to know where to send data in future transmissions.

  • destination MAC address
  • source MAC address

every Ethernet frame has this and when the frame hits a switch or any device, any device can look at it ( an Ethernet frame ) and know where it is suppose to go and where it came from.

Every switch has a MAC address table where it stores MAC addresses of different computers on the network.

Example:

When a PC1 sends a frame to PC2 through a switch, the switch looks at the header of the Ethernet frame for the source mac address and adds the source MAC address to its MAC address table and also the port that it came through.

simply put:

A switch looks at the source MAC address to see if it knows it already, if it does. Great! no need to add it again to it's address table.

If it doesn't, it adds it's source address and the port that the frame came from.

This basically how the switch populates its MAC address table.

3 0
3 years ago
Read 2 more answers
Three primary types of data that a forensic investigator must collect, in this order: 1.Volatile data 2.Temporary data 3.Persist
posledela

Answer:

1. volatile data

2. temporary data

3. persistent data

seems like you already got it correct

Explanation:

7 0
2 years ago
Other questions:
  • list the network characteristics of the wireless network(s) in the decode -- SSIDs, channels used, AP names, presence of Bluetoo
    6·1 answer
  • _____ documentation is designed to help programmers and systems analysts understand the application software and maintain it aft
    12·1 answer
  • A bookmarking site is a website that enables members to manage and share media such as photos, videos, and music. true or false
    14·1 answer
  • Whats the difference between search engine and web browser?
    6·2 answers
  • The Fibonacci numbers are the numbers
    15·1 answer
  • Perform the following conversions from decimal to binary, octal and hexadecimal systems. a) 1710 b) 132110C) 36010d).7510e).3906
    8·1 answer
  • 2 ways to make your computer work faster ( please help asap )
    6·1 answer
  • PLS HELP ILL GIVE BRAINLY- (enter the answer) Microsoft _________ is an example of a desktop publishing software
    13·2 answers
  • Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual whi
    9·1 answer
  • PLS ANSWER ASAP!!!! <br><br> In three to five sentences, explain the function of utilities.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!