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
Why is it important for the scrum master to help the team focus on daily and iteration goals\
pickupchik [31]

Scrum master can help the team focus on daily and iteration goals as it:

  • To facilitate the team's progress towards the current PI Objectives.

<h3>What is the use of Scrum master?</h3>

It is known to be a kind of problem-solving methods that helps a team become very good at problem-solvers for themselves. Note that it often Facilitates  team events and others.

Therefore, Scrum master can help the team focus on daily and iteration goals as it:

  • To facilitate the team's progress towards the current PI Objectives.

See options below

To keep the Team Backlog to a manageable size

To eliminate impediments

To help the team maintain their velocity

To facilitate the team's progress towards the current PI Objectives

Learn more about scrum master from

brainly.com/question/4763588

#SPJ12

4 0
2 years ago
The "network of networks," consisting of LANs (Local Area Networksnetworks connecting two or more computers, usually within the
irina1246 [14]

Answer:

Internet

Explanation:

Internet is very often called the network of networks, creating a bridge between many networks and joining larger networks to another.

5 0
3 years ago
Remember partially filled arrays where the number of elements stored in the array can be less than its capacity (the maximum num
MrMuchimi

Answer:

Complete the main method as follows:

int num;

cin>>num;

int i = 0;

while(num!=0){

array[i] = num;  

cin>>num;

i++;

}

Complete the printArray function as follows:

void printArray(int array[]){

int i =0;

while(array[i]!=0){

   cout<<array[i]<<" ";

   i++;

}}

Explanation:

<u>Main method</u>

This declares a variable that gets input from the user

int num;

This gets input from the user

cin>>num;

This initializes a count variable to 0. It represents the index of the current array element

int i = 0;

while(num!=0){

This inserts the inputted number to the array

array[i] = num;

This gets another input  

cin>>num;

The counter is incremented by 1

i++;

}

The above loop is repeated until the users enters 0

<u>printArray method</u>

This declares the array

void printArray(int array[]){

This initializes a counter variable to 0

int i =0;

This is repeated until array element is 0

while(array[i]!=0){

Print array element

   cout<<array[i]<<" ";

Increase counter by 1

   i++;

}}

<em>See attachment for complete program</em>

Download cpp
8 0
3 years ago
Convert the following denary numbers into binary using 8-bit register:
kobusy [5.1K]

Answer:

9LA+ªÿ

Explanation:

7 0
3 years ago
If two devices simultaneously transmit data on an Ethernet network and a collision occurs, what does each station do in an attem
Arada [10]

Explanation:

Both station will retract their data. They will wait a random amount of time before sending out data again. This lessens the chance of collision again.

8 0
2 years ago
Other questions:
  • Information management examines the organizational resource of information and regulates its definitions, uses, value, and distr
    11·1 answer
  • When you first open office calc, the most recently saved spreadsheet opens up. A) true B) false
    14·1 answer
  • What symbol following a menu command lets you know that a dialog box will be displayed? an arrow a check mark an ellipse a radio
    5·2 answers
  • 1. Why do you think coding languages generally include the ability to create comments? What would those comments be used for? In
    10·1 answer
  • Which is the hanging indent on the ruler?
    10·2 answers
  • ____ is the dubious practice of registering a domain name and then trying to sell the name for big bucks to the person, company,
    5·2 answers
  • Dora has inserted a text box into a Word document that she is formatting. Which strategy will not format text boxes? Create a li
    6·2 answers
  • 1.
    13·1 answer
  • A computer game allows a player to repeat a level until they run out of lives. Which two of the following loops would work corre
    8·2 answers
  • Pleaseeeee helpppppppp​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!