We start seeing questions like:
A car dealer has 10 salespersons. Each salesperson keeps track of the number of cars sold each month and reports it to the management at the end of the month. The management keeps the data in a file and assigns a number, 1 to 10, to each salesperson....
Write the code to store the number of cars sold by each salesperson in the array cars, output the total numbers of cars sold at the end each month, and output the salesperson number selling the maximum number of cars. (Assume that data is in the file cars.dat, and that this file has been opened using the ifstream variable inFile.)
The first thing to understand is that Stack Overflow, and especially Programmers.SE are not code writing services. You don't just throw some a question in there with something of the form "give me the codez" into the text area and hope that someone will
answer the question do your homework.
There are several things to consider as to why this is bad.
The typical class builds upon previous experiences. The compiler class has machine language and data structures as prerequisites because if you don't understand those, you will be hopelessly lost in the class and not even able to understand the lectures.
Lets assume you do understand the code (the person answering the question did a good job explaining it)... the curriculum is designed to take you from
Z with 24 steps between. As industry programmers we often take short cuts and don't need say, steps
ijkl to do something. Learning from us, you'll never get these steps. However you may find in your next assignment or class that understanding
jk is assumed and critical to the understanding of some other concepts. Just because we don't need
ijkl to do it doesn't mean it isn't understood.
An example of this is an anecdote of the machine programming class I took years ago which used SPIM - a MIPS simulator. One of the students when stuck with a program discovered a little used DECStation off on the side of the lab that had gcc on it. Instead of writing the assignment (factorial) by hand with the concepts we had access to (we were supposed to write a recursive function to learn about the stack and frame pointer), he wrote it in C, compiled it with gcc -S and got out a some MIPS assembly source that he then handed in. However, the compiler, recognizing an optimization converted the entire code from recursive subroutine into a for loop and used other things we wouldn't hear mentioned until a few weeks later. He got a '0' on that homework and had trouble with the next one (that assumed you already understood the frame pointer and stack pointer).
It cheats you of the education you are paying to get. Copy and paste takes no skill.
It cheats us of good interview candidates. It is often lamented the quality of college graduates by technical interviewers. You may be enthusiastic, but unless you can write code and explain concepts better than the other guy, we're going to hire the other guy.
Your first resource to look at should be your instructor. They are there for you and want to have you follow a specific path to get to the end point of understanding.
So, you've exhausted the resources. You've tried asking your instructor. You've searched google. You've gone over your lecture notes and even knocked on the TA's door during office hours. And you've come here...
The urgency of your question is not something we are concerned with. Good questions and answers are timeless - not something that needs to be done by 5pm today or 8am on Monday (you may find the rate of answers to drop substantially on the weekends and evenings of various timezones). Don't expect an answer in any given time frame.
As just mentioned, good questions are timeless. Answering your homework problem is likely not timeless and not a good question. Describe the problem you are having, what your understanding of the problem is and where you are confused. For a question from a student, the best questions are often the ones that are asking how to take a single step in understanding rather than trying to leap all the way to the solution.
Realize also that the answer we give may be completely wrong for the path that your instructor is trying to get you to follow. Having previously fought through the problem ourselves, we know and understand when one can jump directly from
il and when one needs to go through each step of
ijkl in a process. Our answers may skip over steps that aren't needed for this particular problem, but may be critical for understanding the next assignment or some problem years down the road where skipping
jk is the wrong answer. In many cases, it is important to follow the curriculum as best as you are able. Going above and beyond is good where one gains a deeper understanding of a problem domain, but one must have the foundation upon which to build.
We want you to do your homework to the best of your ability. Getting points off on an assignment and learning something from that produces a better interview candidate than one who can copy and paste code that got As in school but can't solve a simple problem they've never seen before.
If your question on Programmers.SE is just a copy paste of homework problem, expect it to be downvoted, closed, and deleted - potentially in quite short order.