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
A diagram of a ten-node network that uses ten routers
tiny-mole [99]

The diagram of the of a ten-node network that uses ten routers is given in the image attached.

<h3>What is a node in a network?</h3>

A network node is known to be be seen as the kind of connection point that is seen amidst some network devices such as routers, printers, etc.

Note that they are known to often receive and send data from one network or endpoint to another.

Therefore, The diagram of the of a ten-node network that uses ten routers is given in the image attached.

Learn more about routers from

brainly.com/question/24812743

#SPJ1

3 0
2 years ago
How do you properly turn off a computer?
Ugo [173]

Answer:

with the power button or do the sleep or shut down

and by the type of computer

Explanation:

sry if its wrong

have a good day:)

-XxMissNobodyxX

7 0
2 years ago
Read 2 more answers
What is an compiler?
marissa [1.9K]
The accurate answer is

A compiler takes your source code, it converts the entire thing into machine language and then stores these equivalent machine language instructions in a separate file. We programmers call that the "executable file.

Glad to help :)<span />
6 0
3 years ago
Read 2 more answers
What are your two biggest strengths as a student? How will these strengths help you become a self-directed learner?
zavuch27 [327]

Answer:

5tgggffyfghfh jrhrhek

7 0
3 years ago
Read 2 more answers
explain why the database system would not allow a tuple to be inserted into the database through this view
Andrej [43]
For the view of Exercise 4.18, explain why the database system would not allow a tuple to be inserted into the database through this view.
For reference
For the database of Figure 4.12, write a query to find the ID of each employee with no manager. Note that an employee may simply have no manager listed or may have a null manager. Write your query using an outer join and then write it again using no outer join at all.
OUTER JOIN
select e.ID from employee e left outer join manages m on e.ID = m.ID
where m.manager_id is null;
NO OUTER
select e.ID from employee e where e.ID not in (select m.ID from manages m) or e.ID in (select m.ID from manages m where m.manager_id is null);
6 0
2 years ago
Other questions:
  • 1. Create a view named customer_addresses that shows the shipping and billing addresses for each customer.
    15·1 answer
  • Assure that major, minor, sub1 and sub2 each contain four digit numbersIf less than four digits are entered in major OR minor OR
    5·1 answer
  • Design and implement an application that reads a sequence of up to 25 pairs of names and postal (ZIP) codes for individuals. Sto
    9·1 answer
  • The principle of time preference requries a larger payment in the future than the present. Which situation best illustrates this
    12·1 answer
  • Secure Wi-Fi networks and VPNs use _____ to secure data transferred over a network.
    13·1 answer
  • A third-grade teacher at Potter Elementary School wants a program that allows a student to enter the amount of money a customer
    14·1 answer
  • Why is it important to evaluate the website on which you plan to shop?
    13·1 answer
  • The names of the governing body or organizationds that creates rules for information technology and information communication te
    9·1 answer
  • In python, Create a conditional expression that evaluates to string "negative" if user_val is less than 0, and "non-negative" ot
    12·1 answer
  • A company is looking for an employee to help organize customer information for the sales team. Which computer field includes thi
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!