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
What is a non-example for job application???
antoniya [11.8K]
Putting some piece of information that has no affect on your application whatsoever like if a college student applying to Harvard for Law puts down, “I’m an amazing juggler”. It is nice to know but doesn’t matter.
6 0
3 years ago
Choose a different well-known company that you know of, and describe its direct and indirect competitors. Describe at least 2 di
geniusboy [140]
Nondirect competition is the variance between vendors whose products or services are not the same but that could gratify the consumer need
Lets take exampl of microsoft corporation
The indirect competitors are WHOLE FOODS and WAL-MART
Direct competitors sells the product or services that are same
the direct competitors are Apple, Google, HP, IBM
hope it helps
6 0
3 years ago
Read 2 more answers
Which technology forms the foundation for cloud computing? forms the foundation for cloud computing.
saul85 [17]
The answer is virtualization

Virtualization is the creation of virtual versions of something such servers, storage devices, operating systems, that allows one to share an application or a resource among multiple customers or organizations. It plays a critical role in cloud computing through sharing data that is present in the clouds like application and infrastructure.
5 0
4 years ago
Read 2 more answers
How can you tell that a website is valid and reliable?
larisa86 [58]
If there is an about page where it tells whom made the website, as well as a copyright 2016 on the bottom of the page. This basically means the website is useful and updated by the creators. Another factor which the site doesnt always need but if it has an https at the beginning of the url then it should be good and valid because that means the site is secured. Also factor in the sections where articles are present, if they have a date and an author towards the bottom or top of the article, then it can be trusted as well. Theres a lot more you can look for in a site and validating if it is an okay site but these are a few examples. Hope this helped!:)
3 0
3 years ago
An application ________ is anyone who writes a computer application for one or more platforms.
yarga [219]

Answer:

An Application Programmer

Explanation:

A Programmer is a professional who writes applications for the computer on a platform.

8 0
3 years ago
Other questions:
  • OSHA requires training for employees on the hazards to which they will be exposed.
    12·2 answers
  • ________ reality is the addition of digital information directly into our reality, either to add more detail or to remove unwant
    7·1 answer
  • Life can get busy and hectic but relationships matter what is an effective way to mending relationships that may have been negle
    9·1 answer
  • Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
    6·1 answer
  • Using for loop . Input an integer and identify whether it's EVEN OR ODD ( without using modulo operator )
    9·1 answer
  • A __________ is when the sender cryptographically marks a message with its private key, which is achieved by a cryptographic alg
    12·1 answer
  • Could u help me on this u just have to compare how its alike please help ​
    5·2 answers
  • In this assignment, you will implement an online banking system. Users can sign-up with the system, log in to the system, change
    14·1 answer
  • ________is the most popular public key algorithm available and can be used for digital signatures, key exchange, encryption, and
    10·2 answers
  • Give 5 characteristics of bad capacitor<br> give 5 characteristics of good capacitor
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!