Solved

Time to seconds

Posted on 2000-03-17
13
208 Views
Last Modified: 2010-04-10
I have to write a function which takes as its argument 3 integers representing hours, minutes and seconds. This functions should return a long integer representing the total number of seconds. I have to also write a test driver for this function. Please help!
0
Comment
Question by:essy
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 5

Accepted Solution

by:
Jan Louwerens earned 50 total points
Comment Utility
long Seconds(int hours, int minutes, int seconds)
{
   return (hours * 3600) + (minutes * 60) + seconds;
}
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
We cannot provide answers to school assignments.  That is grounds for removal from this site.  (for both you and the experts involved.)  We can provide only limitied help in accademic assignments.    We can answer specific (direct) questions, like you might ask your teacher.  We can review your work and post suggestions, again, like your teacher might do.

Do you have specific questions?
Do you have any work on this (incomplete even) that we can review?

jlouwere, please make not of this!
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
That was supposed to be "make note of this"
0
 
LVL 5

Expert Comment

by:Jan Louwerens
Comment Utility
yes, I realized that, but I figured pretty much anyone could convert hours/minutes/seconds to just seconds. I purposely left out the test driver part for that reason. But your point is ttill taken.
0
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
nietod,

I know that you suggested the academic rule, but as it's worded I don't see where an expert can be held liable for answering a supposed assignment. Here is the text from the guidelines:

"violate the guidelines for academic honesty.  ("Academic Honesty" means performing all academic work without plagiarism, cheating, lying, tampering, stealing, receiving unauthorized or illegitimate assistance from any other person, or using any source of information that is not common knowledge)."

As this is worded, it implies that the onus is on the person asking the question. I searched the site for "Academic Honesty" and only found your two submissions.

This question could be just a question...

Steve
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
>> I searched the site for "Academic Honesty"
>> and only found your two submissions

You didn't search it well.   There have been numerious discussions about this topic (including some by the EE advisory board), and my note there is used by several experts in addition to myself and probably appears in several questions every day.

>> As this is worded, it implies that the onus
>> is on the person asking the question.
True.  But that's actually an improvement.  The last time I saw it, it didn't define the term at all.  I complained and this is probably the result.  I'll complain again.  Eventually they'll throw me off.

>> I don't see where an expert can be held
>> liable for answering a supposed assignment
Experts can be (and have been) removed for unethical behavior.  I don't know if any experts have been removed for accademic dishonesty, but they certainly have been warned about it in some instances.

>> This question could be just a question...
It could be, but it is unlikely.  It certainly isn't the question of an experienced programmer.  It is question of a beginner, so whethor or not it is for an assignment, it would be in essy's interest to attempt the work and get feedback, rather than be spoodfeed the answer.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
Where is this information you are referring to? If it's not in the posted guidelines --- then it can't be considered to be a rule. If this is a rule then it should be clearly spelled out, not implied or buried in some "discussions"...
0
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
The point I'm trying to make is that I shouldn't have to search for a rule that could cause my removal from this site... It must be spelled out in an easy to find place.

Thanks
0
 

Author Comment

by:essy
Comment Utility
I apologize for not reading the rules of this site carefully. This was my first time asking a question and therefore did not know the dos and don'ts. I'm a begginner in c++ and just needed some help. What I should have done is posted my incomplete work as well, anyway, next time! Thanks jlouwere.
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
>> It must be spelled out in an easy to find place.
We're working on it.  It takes time.  There was no official mention of accademic honesty 3 months ago.  One issue is that EE doesn't want to encourage the sort of things they are trying to prevent.  Common problems include questions on writting viruses, on pirating software, on hacking into protected sites etc.  These topics are off limits, but EE doesn't want to spell this out in the agreement because it would probably encourage these questions from people who hadn't thought to ask.

>> I apologize for not reading the rules of this site carefully
No problem.
0
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
My point is that you shouldn't be telling experts that they can get removed from the site for answering a question that might me construded as "an assignment" when there isn't anything in the guidelines regarding this... If it should be a rule then say it in the guidelines.

I don't think that this issue can be compared with the destructive programming behaviors such as viruses or hacking through protected sites. That is an abomination that no programmer should endorse or support.

Thanks you for making this site better. But, until it's in writing, it's not a rule and you shouldn't advertise it as a rule...
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
>> you shouldn't be telling experts that they
>> can get removed from the site for
>> answering a question that might me
>> construded as "an assignment"
Well, I don't have the authority to say anything official like that.  (As a advisory board member, EEpays a  little more attention to my suggestions than those of the general experts, but I don't have any "power".)  It is meerly a warning that it is ground for removal from the site.  Which is intirely true.  I don't know of a case where anyone was actually removed--not that I would necessarily know if it--but I do no of cases where EE customer support have...repremanded...experts for this.

>> If it should be a rule then say it in the guidelines.
I'll try to get that changed in the next release.  I did mention it in the last release and apparantly they changed it some.  

What I hope to do is have ia a short EE code ethics that mentions this among other things (like not answering a question using the info a previous expert posted in a comment, not answering with a total guess, that sort of thing.)
0
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
Well thanks for your efforts. This is a great forum to get help and to learn.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now