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
andrew-mc [135]
4 years ago
7

Flesh out the body of the print_seconds function so that it prints the total amount of seconds given the hours, minutes, and sec

onds function parameters. Remember that there are 3600 seconds in an hour and 60 seconds in a minute.

Computers and Technology
1 answer:
fiasKO [112]4 years ago
8 0

Answer:

Step by step explanation along with code and output is provided below

Explanation:

#include<iostream>

using namespace std;

// print_seconds function that takes three input arguments hours, mints, and seconds. There are 60*60=3600 seconds in one hour and 60 seconds in a minute. Total seconds will be addition of these three  

void print_seconds(int hours, int mints, int seconds)

{

   int total_seconds= hours*3600 + mints*60 + seconds;

   cout<<"Total seconds are: "<<total_seconds<<endl;

}

// test code

// user inputs hours, minutes and seconds and can also leave any of them by  entering 0 that will not effect the program. Then function print_seconds is called to calculate and print the total seconds.

int main()

{

   int h,m,s;

   cout<<"enter hours if any or enter 0"<<endl;

   cin>>h;

   cout<<"enter mints if any or enter 0"<<endl;

   cin>>m;

   cout<<"enter seconds if any or enter 0"<<endl;

   cin>>s;

   print_seconds(h,m,s);

  return 0;

}

Output:

enter hours if any or enter 0

2

enter mints if any or enter 0

25

enter seconds if any or enter 0

10

Total seconds are: 8710

You might be interested in
CHALLENGE ACTIVITY 7.3.1: Functions: Factoring out a unit-conversion calculation. Write a function so that the main() code below
77julia77 [94]

Answer:

See Explaination

Explanation:

#include <stdio.h>

MphAndMinutesToMiles()

{

double milesPerHour;

double minutesTraveled;

double hoursTraveled;

double milesTraveled;

scanf("%lf", &milesPerHour);

scanf("%lf", &minutesTraveled);

hoursTraveled = minutesTraveled / 60.0;

milesTraveled = hoursTraveled * milesPerHour;

printf("Miles: %lf\n", milesTraveled);

}

int main()

{

MphAndMinutesToMiles();

return 0;

}

4 0
3 years ago
True or false: if we’re short side the subject in our composed frame, we have given the subject the maximum amount of “lead room
denis-greek [22]
I think it’s false I’m not to sure
3 0
3 years ago
It is illegal to have __________ emergency lights on your vehicle.
Alexxx [7]

Answer is A. Red and Blue

This because these are the same color of emergency lights that are used on Emergency vehicles like ambulances, police cars, fire trucks, etc. We wouldn't want normal citizens confusing drivers with police officers in case of an actual emergency.

8 0
3 years ago
Read 2 more answers
Item 19 A student pushes a box across a rough horizontal floor. If the amount of work done by the student on the box is 100 J an
tatiyna

Answer:

60 J

Explanation:

Given,

Work done to push the box = 100 J

Energy dissipated by friction = 40 J.

According to work energy theorem work done is equal to change in kinetic energy.

Change in Kinetic energy = Work done by student + Work done by friction

Change in Kinetic energy = 100 J - 40 J

Work done by the friction will be negative because it will act in opposite direction of force applied.

Change in Kinetic energy = 60 J

4 0
4 years ago
Explain the five generations of computer
liubo4ka [24]

Answer:

1 First Generation

The period of first generation: 1946-1959. Vacuum tube based.

2 Second Generation

The period of second generation: 1959-1965. Transistor based.

3 Third Generation

The period of third generation: 1965-1971. Integrated Circuit based.

4 Fourth Generation

The period of fourth generation: 1971-1980. VLSI microprocessor based.

5 Fifth Generation

The period of fifth generation: 1980-onwards. ULSI microprocessor based.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Java - Given a String variable response that has already been declared, write some code that repeatedly reads a value from stand
    12·1 answer
  • The technology Herman Hollerith created in the 1880s began the modern-day data processing function in computers.
    5·1 answer
  • You can change the color of the value of a cell or the background
    14·2 answers
  • Match the file extensions to the file types. Some file types may be used more than once.
    11·1 answer
  • What is the term that is used to describe a computer system that could store literary documents, link them according to logical
    10·1 answer
  • Now suppose there are four links between source and destination (three routers in the path between source and destination). Each
    8·1 answer
  • Freeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee points
    14·2 answers
  • When light does not pass through or bounce off an object, it is said to be
    13·2 answers
  • Describe PROM, EPROM and EEPROM memories​
    7·1 answer
  • Which tab should you use to change the text font color in your presentation?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!