| | |
Giving code to posters rather than helping them
![]() |
•
•
Join Date: Oct 2006
Posts: 57
Reputation:
Solved Threads: 2
<< This thread is split off from a discussion that originated here: http://www.daniweb.com/forums/thread62976.html >>
Here;s something you can work on. It may not be exactly what you need but its a basis at least. Also, why do you need to check if the second number of the division is zero, from the second you say it will accept values from 1-20?? Anyway, I put the check in the program as well if u need it for later on.. Hope it helps, byee
Here;s something you can work on. It may not be exactly what you need but its a basis at least. Also, why do you need to check if the second number of the division is zero, from the second you say it will accept values from 1-20?? Anyway, I put the check in the program as well if u need it for later on.. Hope it helps, byee
#include <iostream>
#include <ctime>
using namespace std;
int DoMenu();
void addition(int random1, int random2);
void subtraction(int random1, int random2);
void multiplication(int random1, int random2);
void division(int random1, int random2);
int main()
{
int random1, random2;
srand(time(0));
int choice;
do
{
random1 = 1+(rand()%20); // from 1-20
random2 = 1+(rand()%20); // from 1-20
choice = DoMenu();
switch (choice)
{
case 0: cout << endl; break;
case 1: addition(random1,random2); break;
case 2: subtraction(random1,random2); break;
case 3: multiplication(random1,random2); break;
case 4:
{
if (random2 == 0)
cout << "Error: Division by zero, cannot proceed\n";
else
division(random1,random2);
} break;
default : cout << "Error in input\n\n"; break;
}
} while (choice != 0);
return 0;
}
int DoMenu()
{
int MenuChoice;
cout << "(1)Addition\n";
cout << "(2)Subtraction\n";
cout << "(3)Multiplication\n";
cout << "(4)Division\n";
cout << "(0)Quit\n";
cout << "-----------------\n";
cout << "Choice: ";
cin >> MenuChoice;
return MenuChoice;
}
void addition(int random1, int random2)
{
int answer;
cout << "\n" << random1 << " + " << random2 << " = ";
cin >> answer;
if (answer == (random1+random2))
cout << "Congratulations\n\n";
else
cout << "Incorrect\n\n";
}
void subtraction(int random1, int random2)
{
int answer;
cout << "\n" << random1 << " - " << random2 << " = ";
cin >> answer;
if (answer == (random1-random2))
cout << "Congratulations\n\n";
else
cout << "Incorrect\n\n";
}
void multiplication(int random1, int random2)
{
int answer;
cout << "\n" << random1 << " * " << random2 << " = ";
cin >> answer;
if (answer == (random1*random2))
cout << "Congratulations\n\n";
else
cout << "Incorrect\n\n";
}
void division(int random1, int random2)
{
int answer;
cout << "\n" << random1 << " / " << random2 << " = ";
cin >> answer;
if (answer == (random1/random2))
cout << "Congratulations\n\n";
else
cout << "Incorrect\n\n";
} Last edited by cscgal; Dec 3rd, 2006 at 6:03 am. Reason: Explanation about thread split
*sigh* Hey there May4life I know what I am saying is not officially according to the Daniweb rules but you are spoiling the newbies.
Just handing them readymade solutions will stunt their development in these things, they would never think of doing things their own, will always expect an easy answer, and much more.
Can't you atleast let these people have a shot of it....
We have already been there with you (I suppose a PM was sent to you) but still you must think that the thing "hope it helped" isn't helping them but just harming them in an irreversible way.
Hope you understand the point I am trying to prove..
Just handing them readymade solutions will stunt their development in these things, they would never think of doing things their own, will always expect an easy answer, and much more.
Can't you atleast let these people have a shot of it....
We have already been there with you (I suppose a PM was sent to you) but still you must think that the thing "hope it helped" isn't helping them but just harming them in an irreversible way.
Hope you understand the point I am trying to prove..
I don't accept change; I don't deserve to live.
•
•
Join Date: Oct 2006
Posts: 57
Reputation:
Solved Threads: 2
•
•
•
•
*sigh* Hey there May4life I know what I am saying is not officially according to the Daniweb rules but you are spoiling the newbies.
Just handing them readymade solutions will stunt their development in these things, they would never think of doing things their own, will always expect an easy answer, and much more.
I totally understand your point of view but as you said, i'm not doing anything against the rules here. I respect the rules and try as much as I can to stay within the limits of what i do.
As for "spoiling" newbies, I too am quite new at this stuff (i've only been learning C++ for nearly 3 months now) and I got as far as I have by studying other people's examples and solutions, in the same way that I am helping others in here now.
•
•
•
•
Can't you atleast let these people have a shot of it....
We have already been there with you (I suppose a PM was sent to you) but still you must think that the thing "hope it helped" isn't helping them but just harming them in an irreversible way.
Hope you understand the point I am trying to prove..

As I also mentioned in that, there are many ways to solve a problem, I just give one which i believe is best. Now, if the person that gets this code decides to simply take it, copy it and give it in as his/her own work without at least making the effort of understanding it, that's their problem in the sense that they will most likely fail their written exam or get caught in the act (maybe someone else in the same forum is taking the same class and decides to copy the code). I have absolutely nothing to lose; instead I like not only taking these programs and solving them as a test to myself, but I also like making other people happy and calming them down after the agonizing hours they've already spent trying to solve their problem.
I just want to make it clear that I am not trying to give people easy solutions to their homework, I am not trying to get anyone in trouble.. I just give them a method for easier studying (if they want it). I just want everyone to know the ways I (personally as myself) would face and handle certain programming problems. I also mention this in the PMs I get from people that need help with their programs, not only in this forum but all the others I am signed up with. I have no problem with other programmers saying stuff like "I would use this instead of what you use", or "Your code isnt as efficient as mine". That's how we learn and also understand new concepts.
Making people happy is very easy to do, keeping everyone happy is the hardest! I am really sorry if what I'm doing affects you in a bad way, but to tell u the truth, this is the reason I sign up to forums.
Up to now its been great and honestly this is the best forum so far, by far!! I've made loads of friends and get a lot of practice and knowledge from other people. And as far as my programming skills are concerned, I have found that these forums are the best and fastest way to learn!
Last edited by may4life; Nov 28th, 2006 at 5:39 pm.
*sigh*
Maybe time will teach you or tell you the reason why the professionals are not in favor of posting entire solutions.
And just one more thing which I picked from the google groups:
"Anyone can write a program, but to help somone in understanding a program is what makes a real programmer"
Try to walk through the newbies and then you will realize how difficult it is.
Anyways I havent got anything more to say. Glad you replied.
Maybe time will teach you or tell you the reason why the professionals are not in favor of posting entire solutions.
And just one more thing which I picked from the google groups:
"Anyone can write a program, but to help somone in understanding a program is what makes a real programmer"
Try to walk through the newbies and then you will realize how difficult it is.
Anyways I havent got anything more to say. Glad you replied.
I don't accept change; I don't deserve to live.
•
•
•
•
As for "spoiling" newbies, I too am quite new at this stuff (i've only been learning C++ for nearly 3 months now) and I got as far as I have by studying other people's examples and solutions, in the same way that I am helping others in here now.
•
•
•
•
As I also mentioned in that, there are many ways to solve a problem, I just give one which i believe is best. Now, if the person that gets this code decides to simply take it, copy it and give it in as his/her own work without at least making the effort of understanding it, that's their problem in the sense that they will most likely fail their written exam or get caught in the act. I have absolutely nothing to lose;
•
•
•
•
instead I like not only taking these programs and solving them as a test to myself, but I also like making other people happy and calming them down after the agonizing hours they've already spent trying to solve their problem.
I, for one when learning, almost never forget the stupid mistakes that I make at first if I spend a while trying to solve them. When programming in C++ now, it's very rare that I mistakenly forget to put a semicolon at the end of my sentance.
•
•
•
•
I just want to make it clear that I am not trying to give people easy solutions to their homework, I am not trying to get anyone in trouble.. I just give them a method for easier studying (if they want it).
Probably not. They can be somewhat cryptic and confusing, and it takes experience to know what each message means and what is wrong with your code. Also, coding experience helps you prevent errors from happening, as you get into a routine of placing a semicolon at the end of each statement, etc, etc.
So, although someone *might* actually try to learn from the code you give them, why not actually explain what it does? Coding books are not made entirely out of code; they have text to explain what the code does. And although you say "the student can do what he wants with the code," the disappointing fact is that it's almost like placing a little kid next to a cookie jar and saying "don't eat the cookies inside". Take away the temptation, and the student won't do it. You may actually be saving them from failing the class by not handing them their assignments.
I'm with Mr. ~s.o.s~ on this one.
"Technological progress is like an axe in the hands of a pathological criminal."
All my posts may be freely redistributed under the terms of the MIT license.
All my posts may be freely redistributed under the terms of the MIT license.
Interesting. That's at least 3 that think your analysis does not help new programmers. What is it you understand that seasoned professionals (at least one of which has experience as a teacher) are missing? Especially being new yourself?
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
•
•
Join Date: Oct 2006
Posts: 57
Reputation:
Solved Threads: 2
•
•
•
•
Hmm, so if you're a newbie, you hand them some code that may not necessarily be correct or using proper coding practices, and say "here, learn from this," what do you think that is going to teach them, even if they do study and try to learn from it?
•
•
•
•
Yes, you have nothing to lose, but what about the newbies? Do you think if we handed code to every single person that was having trouble, they would study it? If we actually try to explain things to them and not simply say "learn my example", they will perhaps learn how the code works, and then when a test or exam comes, they will do well!
Which do you think will help them remember better: if they've spent agnoizing hours on it until someone finally explains it and it makes sense, or if they've just been dumped a pile of code and said "here, have fun"?
The general idea i'm trying to get across is that i am giving out my idea of how I would solve that problem (and also giving the code of how to do it). I urge people to look at my code (to understand how i thought of overcoming the problem) and then give it a go with their own ideas. A lot of people here are vert smart, they are just confused or stuck on an idea or concept. By seeing how I overcame that specific point in the program clears these thoughts out and lets them continue onwards from there. That's what I mean when i say they have spent hours trying to solve their problem.
•
•
•
•
So, although someone *might* actually try to learn from the code you give them, why not actually explain what it does? Coding books are not made entirely out of code; they have text to explain what the code does. And although you say "the student can do what he wants with the code," the disappointing fact is that it's almost like placing a little kid next to a cookie jar and saying "don't eat the cookies inside". Take away the temptation, and the student won't do it. You may actually be saving them from failing the class by not handing them their assignments.
•
•
•
•
What is it you understand that seasoned professionals (at least one of which has experience as a teacher) are missing? Especially being new yourself?
•
•
•
•
Do you think if we handed code to every single person that was having trouble, they would study it?
Which do you think will help them remember better: if they've spent agnoizing hours on it until someone finally explains it and it makes sense, or if they've just been dumped a pile of code and said "here, have fun"?
Programming boils down to 2 things: experience and discipline.
Also, coding experience helps you prevent errors from happening, as you get into a routine of placing a semicolon at the end of each statement, etc, etc.
Coding books are not made entirely out of code; they have text to explain what the code does.

•
•
•
•
Being a teacher, you too should know that a lot of teachers teaching the same subject have different methods. Same syllabus, different ways of communicating. Imagine if you never gave any code in the class, just teached theory and told the students to go out and google "linked lists"..
Dont you ever wonder why the people at Google Groups( one of the finest C++ message board on earth) never hand out complete solutions to people unless they see an atttempt ? There must be something that you are missing and they have understood quite well.
Try to guide a newbie through his question and you will know how difficult it is. Finallly I will go out to be euphemistic and say that *you are killing the programming spirit*.
Thank you.
I don't accept change; I don't deserve to live.
•
•
Join Date: Oct 2006
Posts: 9
Reputation:
Solved Threads: 0
Is there possibly a happy medium?
I am a "newbie" - I am as new as they come, taking my very first ever programming class which happens to focus on C++. There were no prerequisites for this class but the teacher I have seems to assume that everyone in the class has had some experience with programming. In many cases, he is right, but there are some of us that have had no experience at all.
I have posted for help a couple of times and have gotten some help, or have gotten absolutely no response and sometimes I just get personal messages telling me to put my code in tags. It was may4life that has helped me the most. First of all, may4life explained to me what it meant to put my code in tags, since I am a newbie who truly doesn't know anything about programming for the life of me couldn't figure out what that even meant. Second of all, I don't think it's fair to assume that all the students out there just post their problems wanting someone else to do the work. I, myself, have spent countless hours reading my assignments, going through my class notes, I even bought a book at Barnes and Noble called "Teach yourself C++ in 24 hours", still I can spend 10-12 hours in front of the computer on a Sunday afternoon and not be able to figure out where to begin with a program. I can write out in English what I want the program to do, but sometimes can't come up with any code to get myself started. may4life has helped me out, given me code, which I then studied and played with to figure out what the purpose of each line of the code was for.
To me, it's kind of like learning a foreign language, sometimes you can't come up with words on your own, but you can read it and translate it in your head, and this helps you learn the language. That is exactly where I am with this C++ programming. So, though I understand that a small percentage of people could be posting just to get out of doing their homework, please don't assume that all of us are doing that. I, myself, wouldn't dream of turning in someone else's work without understanding each piece of it and modifying it to make it my own.
This website is fantastic and I appreciate the fact that you all are out there to help, but please understand that some of us are so new at this that we need a push, and without help we don't even know where to start with the code.
Just wanted to let you know where a true "newbie" is coming from.
Thanks,
confused!
I am a "newbie" - I am as new as they come, taking my very first ever programming class which happens to focus on C++. There were no prerequisites for this class but the teacher I have seems to assume that everyone in the class has had some experience with programming. In many cases, he is right, but there are some of us that have had no experience at all.
I have posted for help a couple of times and have gotten some help, or have gotten absolutely no response and sometimes I just get personal messages telling me to put my code in tags. It was may4life that has helped me the most. First of all, may4life explained to me what it meant to put my code in tags, since I am a newbie who truly doesn't know anything about programming for the life of me couldn't figure out what that even meant. Second of all, I don't think it's fair to assume that all the students out there just post their problems wanting someone else to do the work. I, myself, have spent countless hours reading my assignments, going through my class notes, I even bought a book at Barnes and Noble called "Teach yourself C++ in 24 hours", still I can spend 10-12 hours in front of the computer on a Sunday afternoon and not be able to figure out where to begin with a program. I can write out in English what I want the program to do, but sometimes can't come up with any code to get myself started. may4life has helped me out, given me code, which I then studied and played with to figure out what the purpose of each line of the code was for.
To me, it's kind of like learning a foreign language, sometimes you can't come up with words on your own, but you can read it and translate it in your head, and this helps you learn the language. That is exactly where I am with this C++ programming. So, though I understand that a small percentage of people could be posting just to get out of doing their homework, please don't assume that all of us are doing that. I, myself, wouldn't dream of turning in someone else's work without understanding each piece of it and modifying it to make it my own.
This website is fantastic and I appreciate the fact that you all are out there to help, but please understand that some of us are so new at this that we need a push, and without help we don't even know where to start with the code.
Just wanted to let you know where a true "newbie" is coming from.
Thanks,
confused!
![]() |
Similar Threads
- java application that will print to patterns (Java)
- (Help) I have look at my book to many times and its not helping me! (Java)
- find out the error in my code (Java)
- NEED HELP ON TOPIC : "INTELLECTUAL PROPERTY & HR EXPERTISE DATABASE IN S/W COMPANY" (C)
Other Threads in the IT Professionals' Lounge Forum
- Previous Thread: Switching to .NET ?
- Next Thread: IT spastic
| Thread Tools | Search this Thread |
1gbit advertising advice amazon answers archive british broadband business businessprocesses career carrier censorship cern china cio collectiveintelligence connectivity consumer consumers corporateearnings datatransfer debtcollectors dictionary digg digital ebay ecommerce email employment environment facebook food government grid high-definition hottub infodelivery infotech intel internet interview ipod isp japan kindle lhc library malware marketing mit moonfruit news onlineshopping piracy piratebay pope porn program questions r&d religion remoteworking research retail security sex shopping simple skype smallbusiness smb sms socialmedia socialnetworking software softwareengineer spam speed spending startrek statistics stocks study stumbleupon survey tabletpc technology touch-screen touchscreen twitter uk videoinprint voips web webdeveloper windows words






