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
Llana [10]
3 years ago
12

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:
goblinko [34]3 years ago
7 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
Nicole is in a study group to prepare for a test on plant biology, a subject she knows a lot about. During their meetings, she a
Anestetic [448]

Answer:

b

Explanation:

i pretty sure it b , yep it is b

4 0
3 years ago
Read 2 more answers
The following is a function:
Lunna [17]

Answer:

c

Explanation:

i took test

7 0
2 years ago
Four actions that can be implemented on a database to autocorrect violations of referential integrity, and the outcomes of the a
Paraphin [41]

Answer:

Follows are the matching to this question:

Option \ a \to \ Option \ 3\\\\Option \ b \to \ Option \ 4\\\\Option \ c \to \ Option \ 1\\\\Option \ d \to \ Option \ 2\\

Explanation:

While time-consuming or prone to errors mechanical adjustments to both the referential, databases could be configured with four measures to engine violations. The restricted action causes the insert, update, and removes to only be denied. Set Null to NULL sets the invalid external key, whereas Set Default to a specific core consideration specified in SQL sets a default foreign key. Its Cascade operation spreads the main changes in external keys.

6 0
3 years ago
Nick won a $1,000 lottery prize. He can't decide what he should spend the money on. For some time now, he has been planning to b
miv72 [106K]
The opportunity cost is the full cost of the trip
4 0
3 years ago
When a program lets the user know that an invalid menu choice has been made, this is an example of?
kolezko [41]

The question has the multiple choices below

A) Input validation
B) output correction
C) compiler criticism
D) output validation

The answer is (A) Input validation

Also known as data validation, it is the correct and proper testing of any input supplied by an application or a user. It prevents wrongly formed data from entering the system. Applications should be able to check and validate every input entered into the system since it is hard to detect a malicious user trying to gain entry into software.










5 0
3 years ago
Other questions:
  • The n modifier after the tilde forces the index variable to expand only to the ______
    15·1 answer
  • You are most likely to use<br> images for photos or digital paintings.
    6·1 answer
  • On the Cities worksheet, click cell H13 and enter the function that calculates the total costs for the first city. Copy the func
    14·1 answer
  • Write a for loop to print all NUM_VALS elements of vector courseGrades, following each element with a space (including the last)
    11·1 answer
  • Suppose you are purchasing something online on the Internet. At the website, you get a 10% discount if you are a member. Additio
    12·1 answer
  • A collection of computers, printers, routers, switches, and other devices
    15·1 answer
  • Which is the best reason for why it is important to be careful about entering personal information online?
    10·2 answers
  • PLEASE HELP ASAP
    15·1 answer
  • THis took FOREVER! please go check it out, if you have seen my demo to this game, you will like the full version! https://scratc
    9·2 answers
  • Can u guys report me as much as u can I’m trying to delete this account
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!