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
Ilia_Sergeevich [38]
3 years ago
6

In function main prompt the user for a time in seconds. Call a user defined function to calculate the equivalent time in hours,

minutes, and seconds. Parameters should be the time in total seconds and pointers to the hours, minutes, and seconds. Print the equivalent in hours, minutes, and seconds in function main. Test with a value of 36884 seconds Output should look something like this: 5000 seconds can be broken into 1 hour 23 minutes and 20 seconds"

Computers and Technology
1 answer:
Molodets [167]3 years ago
4 0

Answer:

#include <iostream>

#include <cmath>

using namespace std;

int main()

{

   cout<<"Enter time in seconds:";

   int time, hour, minutes, seconds,initialTime;

   

   cin>>time;

   initialTime = time;

   

   hour = floor(time / 3600);

   time = time % 3600;

   minutes = floor(time / 60);

   time = time % 60;

   seconds = time;

   cout<< initialTime<<" can be broken down into: "<<endl;

   cout<<hour << " hour(s)"<<endl;

   cout<<minutes <<" minutes"<<endl;

   cout<<seconds <<" seconds"<<endl;

   return 0;

}

Explanation:

The programming language use is c++

The module cmath was called to allow me perform some math operations like floor division, and the Iostream allows me to print output to the screen. Using namespace std allows me to use classes from the function std.

I prompt the user to enter time in second, then declare all the variables that will be used which include time, hour, minutes, seconds and initialTime.

initialTime is used to hold the the time input entered by the user and will be printed at the end no arithmetic operation is carried out on it.

Floor division (returns the quotient in a division operation) and Modulo (returns the remainder in a division operation) division is used to evaluate the hours, the minutes and the seconds.

The final answers are then printed to the screen.

I have uploaded the c++ file and a picture of the code in action

You might be interested in
The document asks about dependents because the number can
BARSIC [14]
The answer is: Lower overall taxes
8 0
3 years ago
Read 2 more answers
Which command displays the status of the ipsec installation?
Alexandra [31]
Character command shows the status.
8 0
3 years ago
You try to enter your name into a cell that accepts a numeric value. What error would you receive
Phoenix [80]
Because it say numeric value that means numers and words/letters aren't numbers so it will say not a numeric value :) hope it helps

7 0
3 years ago
Read 2 more answers
Linda installed a special pool for the hydrotherapeutic treatment of severe arthritis, as prescribed by her doctor. The cost of
stellarik [79]

Answer:

Linda is entitled to deduction (before any AGI limitations) of $896 in one year of installation of the pool.

Explanation:

Following is explained calculation for deduction (before any AGI limitations) that is Linda entitled to in the year of installation of the pool.

Given that:

Cost of Installing the pool = $22,400

Paid by insurance company = $5,600

So by deducting the price paid by insurance company from total cost the balance becomes:

Balance = $22,400 - $5,600 = $ 16,800

As the pool increased the value of house by $7,840 so we will deduct this amount from balance:

Balance = $ 16,800 - $7,840 = $8,960

As the useful life given for pool is 10 years so we will divide the balance with 10 to obtain the deduction amount for 1 year:

Deduction amount for one year = $8,960/10 = $8,96

Hence $8,96 will be deducted in one year installation.

i hope it will help you!

7 0
3 years ago
MARKING BRAINLIEST
BabaBlast [244]

Answer: Well, first of all, you might want to change websites. I suggest khan academy.

anyways if your a begnner *Like me* The you might wanna try Java Script! in other words i do not know how to work Python

8 0
3 years ago
Other questions:
  • Which cisco ios command is used to display the current ospf neighbors and their rids?
    11·1 answer
  • Samantha plans an investigation in which she will study a population of animals. Which of these answers best describes the focus
    8·1 answer
  • If(moreDate == true)
    7·1 answer
  • Please help! Answer this question if you know computer science very well. I need help with computer science.
    13·1 answer
  • Johnathan was assigned to complete a project with three other people. What benefit will he get from working with the team?
    15·1 answer
  • User Interface Design ensures that the interface has elements that are easy to ________________. (Choose all that apply)
    10·2 answers
  • WHAT IS MULTIMEDIA SUPPOSED TO MEAN ???
    15·2 answers
  • Ano ang humahati ng globo ng equdor
    8·1 answer
  • A. Get a value for x from the user.
    13·1 answer
  • A parent process calling _____ system call will be suspended until children processes terminate.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!