• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Time to seconds

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
essy
Asked:
essy
  • 5
  • 5
  • 2
  • +1
1 Solution
 
Jan LouwerensSoftware EngineerCommented:
long Seconds(int hours, int minutes, int seconds)
{
   return (hours * 3600) + (minutes * 60) + seconds;
}
0
 
nietodCommented:
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
 
nietodCommented:
That was supposed to be "make note of this"
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
Jan LouwerensSoftware EngineerCommented:
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
 
SteveGTRCommented:
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
 
nietodCommented:
>> 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
 
SteveGTRCommented:
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
 
SteveGTRCommented:
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
 
essyAuthor Commented:
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
 
nietodCommented:
>> 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
 
SteveGTRCommented:
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
 
nietodCommented:
>> 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
 
SteveGTRCommented:
Well thanks for your efforts. This is a great forum to get help and to learn.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 5
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now