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]
3 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]3 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
Which type of information should never be given out on social media?
zhenek [66]

Answer:

Sites like Face.book are full of valuable data for people who use social engineering to steal your identity on social media. You should therefore avoid sharing information that's used to verify your identity,

Explanation:

7 0
2 years ago
Read 2 more answers
In the writing process, after you ve narrowed down your topic, you can use the _______ technique to view a topic from different
Veseljchak [2.6K]
It's a. when you finish your topic you can see topic from <span>different perspectives by questioning. Matching will not allow you that.</span>
8 0
2 years ago
Read 2 more answers
Which vendor did IBM select to create the operating system for the IBM PC?
schepotkina [342]
The Answer Is: "Microsoft".
7 0
3 years ago
How many binary digits are in 10^100.
Basile [38]

Answer:

333 binary digits.

Explanation:

8 0
2 years ago
How many rows appear in a truth table for the compound proposition: \[(p \leftrightarrow q) \oplus (\neg p \leftrightarrow \neg
AURORKA [14]
Let me re-write the proposition:

p↔q⊕(¬p↔¬r)∧¬q.

Generally, the number of rows in a truth table depends on the number of Variables. Here we have 3 Variables: p,q and r. Each of them can have either the value of 1 or 0, which gives us 2*2*2 possibilities, or 2³, that is 8 possibilities and 8 rows:

p=0, q=0, r=0
p=0, q=0, r=1
p=0, q=1, r=0
p=0, q=1, r=1
p=1, q=0, r=0
p=1, q=0, r=1
p=1, q=1, r=0
p=1, q=1, r=1







4 0
2 years ago
Other questions:
  • 3) Write a program named Full_XmasTree using a nested for loop that will generate the exact output. This program MUST use (ONLY)
    6·1 answer
  • Tiffany is an instructor at a college that is run on student tuition and not state taxes. Which statement best describes her emp
    6·2 answers
  • The item that is clicked in a JList can be retrieved using the _____ method of JList.
    8·1 answer
  • _______ allows you to add formatting such as shapes and colors to text.
    14·1 answer
  • Difference between ancient and modern mode of information <br> transmission
    12·1 answer
  • Certain files, such as the ____ and Security log in Windows, might lose essential network activity records if power is terminate
    9·1 answer
  • How we can earn from an app​
    12·1 answer
  • A user input is when the user interacts with the program by typing.<br> True<br> False
    11·2 answers
  • Follow me on Tik-Tok​
    7·2 answers
  • A ____ can be used to enter, display, or edit data
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!