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
Answer:
<u>First test:</u> Give a list of disordered numbers to the sorting algorithm an examine if the output is correctly sorted.
<u>Second test:</u> Give a list of ordered numbers to the sorting algorithm an analyze if the output is still correctly ordered.
<u>Third test:</u> Give a list of ordered numbers and some non-numeric values to the sorting algorithm and check how is managed the exception in case of error or if the output is correctly ordered.
Answer:
Explanation:
As a user of GPL v3 software, you have lots of freedom: You can use GPL software for commercial purposes. You can modify the software and create derivative work. You can distribute the software and any derivative work you produce, without having to ask for permission or pay
Answer:
//Here is the for loop in C.
for(n=10;n>0;n--)
{
printf("count =%d \n",n);
}
Explanation:
Since C is a procedural programming language.Here if a loop that starts with n=10; It will run till n becomes 0. When n reaches to 0 then loop terminates otherwise it print the count of n.
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{ // variables
int n;
// for loop that runs 10 times
// when n==0 then loop terminates
for(n=10;n>0;n--)
{
cout<<"count ="<<n<<endl;
}
return 0;
}
Output:
count =10
count =9
count =8
count =7
count =6
count =5
count =4
count =3
count =2
count =1
Answer: Conventions
Explanation: Convention is the writing activity with the components like punctuation,grammar,symbols,note etc to make the written content understandable and clear. This feature is used because people can understand the meaning of content read by them without initializing it later.
As soon as the reader finishing the reading the information should be clear in his/her mind so that they don't have to figure it out after reading.Convention enhances the value of reading and learning by it's feature .