How i write this program Please help me | | |
a program which consists of a class named Student, the class should
consists of three data members Name, Ob_marks, Total_marks and two
member functions Cal_percentage() which calculate the percentage of
the student by the formula (Ob_marks * 100 ) / Total_marks and
Display() which show all information of the student. The class should
also contain the default constructor which initializes all the data
member of the class.
In main program define an object of the Student class and call the
member functions with this object. | | | | re: How i write this program Please help me mohammaditraders@gmail.com wrote: Quote:
a program which consists of a class named Student, the class should
consists of three data members Name, Ob_marks, Total_marks and two
member functions Cal_percentage() which calculate the percentage of
the student by the formula (Ob_marks * 100 ) / Total_marks and
Display() which show all information of the student. The class should
also contain the default constructor which initializes all the data
member of the class.
In main program define an object of the Student class and call the
member functions with this object.
>
http://www.parashift.com/c++-faq-lit...t.html#faq-5.2
--
[there are no x's in my email]
I have the right to remain silent
(and should probably use it as much as possible)
Anything I type can and will be used against me
in a court of idiocy
I have the right to be wrong
(and probably am)
If I can not furnish my own wrongness
I'm sure someone will provide it for me. | | | | re: How i write this program Please help me
On Jun 12, 5:35 pm, Devon Null <theronnights...@xgmailx.comwrote: Quote:
mohammaditrad...@gmail.com wrote: Quote:
a program which consists of a class named Student, the class should
consists of three data members Name, Ob_marks, Total_marks and two
member functions Cal_percentage() which calculate the percentage of
the student by the formula (Ob_marks * 100 ) / Total_marks and
Display() which show all information of the student. The class should
also contain the default constructor which initializes all the data
member of the class.
In main program define an object of the Student class and call the
member functions with this object.
> http://www.parashift.com/c++-faq-lit...t.html#faq-5.2
>
--
[there are no x's in my email]
>
I have the right to remain silent
(and should probably use it as much as possible)
Anything I type can and will be used against me
in a court of idiocy
I have the right to be wrong
(and probably am)
If I can not furnish my own wrongness
I'm sure someone will provide it for me.
only copy and paste this programmm and run
#include <iostream>
#include <conio>
#include <string>
class Student
{
private:
char *name;
int Ob_marks;
int otal_marks;
public:
student();
Student(char&,int);
void cal_percentage();
void display()
};
student::student()
{
int len=strlen(name);
name=new char[len+1];
ob_marks=0;
}
student::sudent(char &n,int om)
{
int len=strlen(n);
name=new char[len+1];
strcpy(name,n);
Ob_marks=om;
}
void student::cal_percentage()
{
otal_marks=(ob_marks*100)/total_marks;
}
void display();
{
cout<<name<<"\t"<<ob_marks<<"\t"<<otal_marks<<endl ;
}
int main()
{
student s1("mohammad",67);
s1.cal_percentage();
s1.display();
return 0;
} | | | | re: How i write this program Please help me
Pramod wrote: Quote:
On Jun 12, 5:35 pm, Devon Null <theronnights...@xgmailx.comwrote: Quote:
>mohammaditrad...@gmail.com wrote: Quote:
>> a program which consists of a class named Student, the class should
>>consists of three data members Name, Ob_marks, Total_marks and two
>>member functions Cal_percentage() which calculate the percentage of
>>the student by the formula (Ob_marks * 100 ) / Total_marks and
>>Display() which show all information of the student. The class should
>>also contain the default constructor which initializes all the data
>>member of the class.
>>In main program define an object of the Student class and call the
>>member functions with this object.
>>
> http://www.parashift.com/c++-faq-lit...t.html#faq-5.2
>>
only copy and paste this programmm and run
>
#include <iostream>
#include <conio>
I didn't have conio on my system (should I?) Quote:
#include <string>
class Student
{
private:
char *name;
use a string here IMHO you should probably should make this lower case for ease of typing,
i.e. ob_marks Quote:
int otal_marks;
public:
student();
Student(char&,int);
there are 2 constructors defined here - that maybe legal, I leave that
to others more knowledgeable than me, but it would not compile on my
system. Also you should define the default values here - see below. Quote:
void cal_percentage();
void display()
missing semi-colon Quote:
};
student::student()
Typo here - C++ is case sensitive. You are trying to use student (lower
case 's') when you defined Student (upper case 'S'). Anyways, this whole
block should be done away with Quote:
{
int len=strlen(name);
not needed, use sizeof(name) Quote:
name=new char[len+1];
ob_marks=0;
doesn't match the Ob_marks defined earlier (case sensitive) Quote:
}
student::sudent(char &n,int om)
Student::Student(string n, int om) Quote:
{
int len=strlen(n);
name=new char[len+1];
strcpy(name,n);
Ob_marks=om;
}
just about this whole block should be re-worked Quote:
void student::cal_percentage()
case sensitive Quote:
{
otal_marks=(ob_marks*100)/total_marks;
total_marks? you mean otal_marks? (as defined above), otherwise
total_marks was never defined. no semi-colon goes here - remove it Quote:
{
cout<<name<<"\t"<<ob_marks<<"\t"<<otal_marks<<endl ;
have to use std:: for cout and endl since you didn't declare your
namespace earlier Quote:
}
int main()
{
student s1("mohammad",67);
again, case sensitive Quote:
s1.cal_percentage();
s1.display();
return 0;
}
>
Now here is a working version (at least on my system):
#include <iostream>
//#include <conio>
#include <string>
class Student
{
private:
std::string name;
int ob_marks;
int otal_marks;
public:
//Student();
Student(std::string n = "",int om = 0);
void cal_percentage();
void display();
};
/*Student::Student()
{
int len=sizeof(name);
name=new char[len+1];
ob_marks=0;
}*/
Student::Student(std::string n,int om)
{
//int len=sizeof(n);
//name=new char[len+1];
//strcpy(name,n);
name = n;
ob_marks = om;
}
void Student::cal_percentage()
{
otal_marks=(ob_marks*100)/otal_marks;
}
void Student::display()
{
std::cout<<name<<"\t"<<ob_marks<<"\t"<<otal_marks< <std::endl;
}
int main()
{
Student s1("mohammad",67);
s1.cal_percentage();
s1.display();
return 0;
}
Now only one problem remains - you never set otal_marks to a meaningful
value.
Anyone want to critique my advice, I am also a beginner.
DN
--
[there are no x's in my email]
I have the right to remain silent
(and should probably use it as much as possible)
Anything I type can and will be used against me
in a court of idiocy
I have the right to be wrong
(and probably am)
If I can not furnish my own wrongness
I'm sure someone will provide it for me. | | | | re: How i write this program Please help me
Pramod <sahgalpramods@gmail.comwrote in message ... Quote:
On Jun 12, 5:35 pm, Devon Null <theronnights...@xgmailx.comwrote: Did you read this FAQ? Quote:
>
only copy and paste this programmm and run
>
#include <iostream>
#include <conio>
Where did this come from? Does it compile? ( I've always seen it as
"conio.h". non-standard.) Quote:
class Student{ private:
char *name;
Why a 'char*'. You included <string>, ** use it **. Quote:
int Ob_marks;
int otal_marks;
public:
WHAT?
// error: ISO C++ forbids declaration of `student' with no type Quote:
Student(char&,int);
void cal_percentage();
void display()
}; // class Student
Quote:
student::student(){
Does not exist. Quote:
int len=strlen(name);
name=new char[len+1];
ob_marks=0;
}
Quote:
student::sudent(char &n,int om){
'sudent' is not declared/defined for, for, ... what the heck is 'student'. Quote:
int len=strlen(n);
name=new char[len+1];
strcpy(name,n);
Ob_marks=om;
}
Quote:
void student::cal_percentage(){
'cal_percentage()' is not declared/defined in, in, ... what the heck is
'student'? Quote:
otal_marks=(ob_marks*100)/total_marks;
}
Quote:
{
cout<<name<<"\t"<<ob_marks<<"\t"<<otal_marks<<endl ;
'name', 'ob_marks' and 'otal_marks' were never declared/defined! Quote:
int main(){
student s1("mohammad",67);
'student' was never declared/defined!! Quote:
s1.cal_percentage();
s1.display();
return 0;
}
If you are going to do peoples homework for them, at least give them
something that will compile (or close to it)!
--
Bob R
POVrookie | | | | re: How i write this program Please help me
"Devon Null" writes:
<snip> Quote:
Now only one problem remains - you never set otal_marks to a meaningful
value.
>
Anyone want to critique my advice, I am also a beginner.
Before trying to fix a program it is nice to know what the program is
supposed to do. In this case, the original problem is upstream in this
thread. You should look at the problem statement before you try to fix
someone else's code. In this case Total_marks had to be provided in a
constructor, there is no way to deduce it from other information. Since
Premed screwed up, you also screw up, so your program can not work. Pramod
has, in general, a very casual attitude towards typing. Furthermore, he
does not know the meaning of "copy and paste", copy and paste means, I
*have* compiled this program and I assert that it *works*. There are weaker
forms to use such as "try this" or "here is something".
I too, thought the variable naming was bad. But in my experience,
instructors can sometimes be picky, why cross them? He is going to give you
a grade, which is really the point of the whole exercise. So let him have
his screwed up names, a hodge-podge of inappropriate capitalization and
underscores. | | | | re: How i write this program Please help me
Devon Null <theronnightstar@xgmailx.comwrote in message... Quote:
>
Now here is a working version (at least on my system):
And *you* should not do their homework either! <G>
We get this very 'assignment' every three months. If the OP does not want to
learn, (s)he should just 'google' for the code. Quote:
>
#include <iostream>
file://#include <conio>
#include <string>
>
class Student{ private:
std::string name;
int ob_marks;
int otal_marks;
public:
file://Student();
Student(std::string n = "",int om = 0);
void cal_percentage();
void display();
};
/*Student::Student()
{
int len=sizeof(name);
name=new char[len+1];
ob_marks=0;
}*/
Quote:
Student::Student(std::string n, int om){
file://int len=sizeof(n);
file://name=new char[len+1];
file://strcpy(name,n);
name = n;
ob_marks = om;
}
void Student::cal_percentage(){
otal_marks=(ob_marks*100)/otal_marks;
}
void Student::display(){
std::cout<<name<<"\t"<<ob_marks<<"\t"<<otal_marks< <std::endl;
}
int main(){
Student s1("mohammad",67);
s1.cal_percentage();
s1.display();
return 0;
}
>
Now only one problem remains - you never set otal_marks to a meaningful
value.
>
Anyone want to critique my advice, I am also a beginner.
Here's one, use constructor 'init lists':
Student::Student( std::string n, int om) : name( n ), ob_marks( om ){}
--
Bob R
POVrookie | | | | re: How i write this program Please help me
Pramod wrote: Quote:
On Jun 12, 5:35 pm, Devon Null <theronnights...@xgmailx.comwrote: Quote:
>mohammaditrad...@gmail.com wrote: Quote:
>> a program which consists of a class named Student, the class should
>>consists of three data members Name, Ob_marks, Total_marks and two
>>member functions Cal_percentage() which calculate the percentage of
>>the student by the formula (Ob_marks * 100 ) / Total_marks and
>>Display() which show all information of the student. The class should
>>also contain the default constructor which initializes all the data
>>member of the class.
>>In main program define an object of the Student class and call the
>>member functions with this object.
> http://www.parashift.com/c++-faq-lit...t.html#faq-5.2
>>
>--
>[there are no x's in my email]
>>
>I have the right to remain silent
> (and should probably use it as much as possible)
>Anything I type can and will be used against me
> in a court of idiocy
>I have the right to be wrong
> (and probably am)
>If I can not furnish my own wrongness
> I'm sure someone will provide it for me.
>
only copy and paste this programmm and run
WTF... do NOT solve homework. Don't do this. Don't. It's evil. Evil, you
know? Refrain to do so. I know, it's difficult sometimes to STFU when
you feel like you know something. But It's better to learn, sooner or later.
Regards,
Zeppe | | | | re: How i write this program Please help me
On Jun 12, 7:55 pm, Devon Null <theronnights...@xgmailx.comwrote: Quote:
Pramod wrote: Quote:
On Jun 12, 5:35 pm, Devon Null <theronnights...@xgmailx.comwrote: Quote:
mohammaditrad...@gmail.com wrote:
> a program which consists of a class named Student, the class should
>consists of three data members Name, Ob_marks, Total_marks and two
>member functions Cal_percentage() which calculate the percentage of
>the student by the formula (Ob_marks * 100 ) / Total_marks and
>Display() which show all information of the student. The class should
>also contain the default constructor which initializes all the data
>member of the class.
>In main program define an object of the Student class and call the
>member functions with this object.
Quote: Quote:
only copy and paste this programmm and run
I presume that Pramod was being sarcastic here, and threw in a
number of errors intentionally, since we aren't here to do
people's homework for them. Quote: Quote:
#include <iostream>
#include <conio>
Quote:
I didn't have conio on my system (should I?)
No. It's not standard, and I don't know of any system which has
it. (Windows usually still has a <conio.h>, which is, however,
mainly there for historical reasons---it was an MS-DOS standard
header.) Quote: Quote:
#include <string>
class Student
{
private:
char *name;
Quote:
IMHO you should probably should make this lower case for ease
of typing, i.e. ob_marks
There are two widespread conventions: separating names using an
_, and mixed case, e.g.: ob_marks, or obMarks. However, the
homework requirements said that the name must be Ob_marks.
(It's rather unusual to find a convention in which a variable
name starts with an upper case, too.) Quote: Quote:
int otal_marks;
public:
student();
Student(char&,int);
Quote:
there are 2 constructors defined here - that maybe legal, I leave that
to others more knowledgeable than me, but it would not compile on my
system. Also you should define the default values here - see below.
There is only one constructor declared here. The first is not a
constructor (case is significant in C++), but a function
declaration, and it is missing the return type.
The actual constructor is, shall we say, "interesting". To call
it, you need a variable of type char---an array will not work,
it must be a single variable. Quote: Quote:
void cal_percentage();
void display()
Quote:
missing semi-colon
Quote: Quote:
};
student::student()
Quote:
Typo here - C++ is case sensitive. You are trying to use student (lower
case 's') when you defined Student (upper case 'S'). Anyways, this whole
block should be done away with
Quote: Quote:
{
int len=strlen(name);
Quote:
not needed, use sizeof(name)
Not at all the same thing! name is an uninitialized pointer.
sizeof(name) gives defined behavior, returning the size of a
pointer on his system (usually 4 or 8, today). Calling strlen
with an uninitialized pointer causes undefined behavior. A lot
more fun to throw at a learner who is too lazy to even try to do
his own homework. Quote: Quote:
name=new char[len+1];
ob_marks=0;
Quote:
doesn't match the Ob_marks defined earlier (case sensitive)
Quote: Quote:
}
student::sudent(char &n,int om)
Quote:
Student::Student(string n, int om)
It's generally more common practice to pass strings by
reference, i.e.:
Student::Student( string const& n, int om )
See above for my comment on the constructor's signature. Quote: Quote:
{
int len=strlen(n);
name=new char[len+1];
strcpy(name,n);
Ob_marks=om;
}
Quote:
just about this whole block should be re-worked
Actually, it's about the only thing that's correct in the entire
program. Or would be correct, if the signature were the
expected:
Student::Student( char const* n, int om )
Of course, in well written code, the members would be
initialized in an initializer list, and not in the body of the
constructor. Quote: Quote:
void student::cal_percentage()
Quote: Quote:
{
otal_marks=(ob_marks*100)/total_marks;
Quote:
total_marks? you mean otal_marks? (as defined above), otherwise
total_marks was never defined.
That's part of the fun of it, no? Quote:
no semi-colon goes here - remove it
Quote: Quote:
{
cout<<name<<"\t"<<ob_marks<<"\t"<<otal_marks<<endl ;
Quote:
have to use std:: for cout and endl since you didn't declare your
namespace earlier
Quote: Quote:
}
int main()
{
student s1("mohammad",67);
Quote:
again, case sensitive
Quote: Quote:
s1.cal_percentage();
s1.display();
return 0;
}
Quote:
Now here is a working version (at least on my system):
I think the point was not to provide a working version.
--
James Kanze (GABI Software, from CAI) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34 | | | | re: How i write this program Please help me
On Jun 12, 8:51 pm, "osmium" <r124c4u...@comcast.netwrote: Quote:
"Devon Null" writes:
Quote: Quote:
Now only one problem remains - you never set otal_marks to a meaningful
value.
Quote: Quote:
Anyone want to critique my advice, I am also a beginner.
Quote:
Since
Premed screwed up, you also screw up, so your program can not work.
The only way he screwed up was not making his irony apparent
enough. (Although I wonder. I found using char& to pass a
string a dead give away.)
Many years ago, when the usual language in CS 101 was C, there
was a tradition among the regulars in comp.lang.c to see who
could come up with the most "creative" responses. The best
could come up with fully working programs which gave the right
results, but which were either obviously wrong (because the
poster found a clever way of making to errors cancel each
other), or worthy of IOCCC, or in some otherway amusing. I
found it a rather pleasant way of handling people asking for
others to do their homework.
--
James Kanze (GABI Software, from CAI) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34 | | | | re: How i write this program Please help me
On Jun 12, 8:27 pm, "BobR" <removeBadB...@worldnet.att.netwrote: Quote:
Pramod <sahgalpram...@gmail.comwrote in message ... Quote:
On Jun 12, 5:35 pm, Devon Null <theronnights...@xgmailx.comwrote:
Quote:
Did you read this FAQ?
I think maybe he did:-).
[...] Quote:
If you are going to do peoples homework for them, at least
give them something that will compile (or close to it)!
The goal of homework is for the person to learn something.
Trying to get what Pramod posted to compile and run will
probably teach the original poster a lot more than if he'd
posted a correct solution:-).
--
James Kanze (GABI Software, from CAI) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34 | | | | re: How i write this program Please help me
On Jun 12, 9:38 pm, Zeppe
<zep_p@.remove.all.this.long.comment.yahoo.itwrote : Quote:
Pramod wrote: Quote:
On Jun 12, 5:35 pm, Devon Null <theronnights...@xgmailx.comwrote: Quote:
mohammaditrad...@gmail.com wrote:
> a program which consists of a class named Student, the class should
>consists of three data members Name, Ob_marks, Total_marks and two
>member functions Cal_percentage() which calculate the percentage of
>the student by the formula (Ob_marks * 100 ) / Total_marks and
>Display() which show all information of the student. The class should
>also contain the default constructor which initializes all the data
>member of the class.
>In main program define an object of the Student class and call the
>member functions with this object.
> http://www.parashift.com/c++-faq-lit...t.html#faq-5.2 Quote: Quote:
only copy and paste this programmm and run
Quote:
WTF... do NOT solve homework.
Look at the code a little bit. Then reconsider this answer. Quote:
Don't do this. Don't. It's evil. Evil, you
know? Refrain to do so. I know, it's difficult sometimes to STFU when
you feel like you know something. But It's better to learn, sooner or later.
If the original poster gets the posted code to compile and run,
he'll have learned a lot. Both about C++ and about how
newgroups work:-).
--
James Kanze (GABI Software, from CAI) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34 | | | | re: How i write this program Please help me
James Kanze wrote: Quote:
On Jun 12, 9:38 pm, Zeppe
<zep_p@.remove.all.this.long.comment.yahoo.itwrote : Quote:
>Pramod wrote: Quote:
>>On Jun 12, 5:35 pm, Devon Null <theronnights...@xgmailx.comwrote:
>>>mohammaditrad...@gmail.com wrote:
>>>> a program which consists of a class named Student, the class should
>>>>consists of three data members Name, Ob_marks, Total_marks and two
>>>>member functions Cal_percentage() which calculate the percentage of
>>>>the student by the formula (Ob_marks * 100 ) / Total_marks and
>>>>Display() which show all information of the student. The class should
>>>>also contain the default constructor which initializes all the data
>>>>member of the class.
>>>>In main program define an object of the Student class and call the
>>>>member functions with this object.
>>> http://www.parashift.com/c++-faq-lit...t.html#faq-5.2 > Quote: Quote:
>>only copy and paste this programmm and run
> Quote:
>WTF... do NOT solve homework.
>
Look at the code a little bit. Then reconsider this answer.
>
Oh, sorry! Really, at a glance it seemed something like a solution.
Sorry for having been rude, dudes! ;P
Regards,
Zeppe | | | | re: How i write this program Please help me
"James Kanze" writes:
On Jun 12, 8:51 pm, "osmium" <r124c4u...@comcast.netwrote: Quote:
"Devon Null" writes:
Quote: Quote:
Now only one problem remains - you never set otal_marks to a meaningful
value.
Quote: Quote:
Anyone want to critique my advice, I am also a beginner.
Quote:
Since
Premed screwed up, you also screw up, so your program can not work.
The only way he screwed up was not making his irony apparent
enough. (Although I wonder. I found using char& to pass a
string a dead give away.)
Many years ago, when the usual language in CS 101 was C, there
was a tradition among the regulars in comp.lang.c to see who
could come up with the most "creative" responses. The best
could come up with fully working programs which gave the right
results, but which were either obviously wrong (because the
poster found a clever way of making to errors cancel each
other), or worthy of IOCCC, or in some otherway amusing. I
found it a rather pleasant way of handling people asking for
others to do their homework.
Yes. Pramod has also cleverly covered his tracks by using variants on the
spelling Pramod and posting beginner type questions to throw naive types
such as me off the trail. Such as asking, in effect, "how do you swap two
values without using a temporary variable?" Or perhaps that was posted by a
different Pramod, perhaps a younger brother? They use the same NNTP posting
host. | | | | re: How i write this program Please help me
James Kanze wrote in message...
On Jun 12, 8:27 pm, "BobR" wrote:
[...] Quote: Quote:
>If you are going to do peoples homework for them, at least
>give them something that will compile (or close to it)!
Quote:
The goal of homework is for the person to learn something.
Trying to get what Pramod posted to compile and run will
probably teach the original poster a lot more than if he'd
posted a correct solution:-).
In other words, I've been had ...AGAIN!! Dang, I hate when that happens!!
<G>
I think it would have been better to post something like I've seen Mr.
osmium (I think) post:
// -----
class Student{ /* minimal declarations */ };
int main(){
Student TheStudent(/*parms*/);
// use the TheStudent here
return 0;
}
// -----
Then ask the student to post his/her problem code.
But, different teachers have different methods (and can all be correct). I
had a teacher in 'continuation school' teach me in 20 minutes what I failed
to learn in 3 years of high school. He simply explained it differently, and
suddenly I got the picture. (Great teacher!)
--
Bob R
POVrookie | | | | re: How i write this program Please help me
Zeppe wrote: Quote:
James Kanze wrote: Quote:
>On Jun 12, 9:38 pm, Zeppe
>> Quote:
>>WTF... do NOT solve homework.
>>
>Look at the code a little bit. Then reconsider this answer.
>>
>
Oh, sorry! Really, at a glance it seemed something like a solution.
Sorry for having been rude, dudes! ;P
>
So I'm lost, did I screw up bad? As I read the FAQ, the only time I was
absolutely forbidden to answer was when there was no code posted. As
there was code posted (albeit mangled code, but an attempt) I was then
allowed to comment on it. I know I probably screwed a lot things up,
thus the disclaimer at the bottom about being a beginner also, but I did
it to the best of my understanding. There I go thinking again. I didn't
mean to rankle anybody's feathers. I apologize if I did and I'll leave
the question answering to others of higher caliber from now on.
DN
--
[there are no x's in my email]
I have the right to remain silent
(and should probably use it as much as possible)
Anything I type can and will be used against me
in a court of idiocy
I have the right to be wrong
(and probably am)
If I can not furnish my own wrongness
I'm sure someone will provide it for me. | | | | re: How i write this program Please help me
Devon Null wrote: Quote:
Zeppe wrote: Quote:
>James Kanze wrote: Quote:
>>On Jun 12, 9:38 pm, Zeppe
>>>
>>>WTF... do NOT solve homework.
>>Look at the code a little bit. Then reconsider this answer.
>>>
>Oh, sorry! Really, at a glance it seemed something like a solution.
>Sorry for having been rude, dudes! ;P
>>
>
So I'm lost, did I screw up bad? As I read the FAQ, the only time I was
absolutely forbidden to answer was when there was no code posted. As
there was code posted (albeit mangled code, but an attempt) I was then
allowed to comment on it. I know I probably screwed a lot things up,
thus the disclaimer at the bottom about being a beginner also, but I did
it to the best of my understanding. There I go thinking again. I didn't
mean to rankle anybody's feathers. I apologize if I did and I'll leave
the question answering to others of higher caliber from now on.
>
DN
The problem is that as you can notice the OP didn't post any code. I
actually suspect that he's not even able to write down an "hello world"
application. Then Pramod wrote down a (intentionally) buggy program to
let the OP think about the problem, but I didn't realised and I
complained. You actually corrected the bugs in that code. The rule about
the homework is not a rigid "if there is code you can correct, if there
is no code you can't write anything". You should put a bit of
common-sense, which means: somebody assigned a homework to the OP in
order to let him learn something. If you want to help, you have to teach
something to that guy. The group is about sharing knowledge, not code.
So, if you can understand that the OP is not looking for knowledge, but
just for somebody that does his homework for him, you'd better not
provide him with the information he asks, that wouldn't help anybody. On
the opposite, it's disruptive for the OP.
When who posts is looking for information and is interested in
understanding something, you are more than welcome to help if you want
to! :)
Regards,
Zeppe | | | | re: How i write this program Please help me
"Devon Null" wrote: Quote:
Zeppe wrote: Quote:
>James Kanze wrote: Quote:
>>On Jun 12, 9:38 pm, Zeppe
>>>
>>>WTF... do NOT solve homework.
>>>
>>Look at the code a little bit. Then reconsider this answer.
>>>
>>
>Oh, sorry! Really, at a glance it seemed something like a solution.
>Sorry for having been rude, dudes! ;P
>>
>
So I'm lost, did I screw up bad? As I read the FAQ, the only time I was
absolutely forbidden to answer was when there was no code posted. As
there was code posted (albeit mangled code, but an attempt) I was then
allowed to comment on it. I know I probably screwed a lot things up,
thus the disclaimer at the bottom about being a beginner also, but I did
it to the best of my understanding. There I go thinking again. I didn't
mean to rankle anybody's feathers. I apologize if I did and I'll leave
the question answering to others of higher caliber from now on.
To me, it was a minor screw up. I think the mistake you made was not going
back to find the original post, the one where the subject is not prefixed
with Re: on my newsreader; I think you got started in the middle of a
thread without knowing it. In case my sarcasm was too dense, or whatever,
the post you answered was a *serious* attempt to answer, and most certainly
not a "witty programmer" response, as theorized here. He (Pramod) shouldn't
have done that. | | | | re: How i write this program Please help me
Zeppe wrote: Quote:
>
The problem is that as you can notice the OP didn't post any code. I
actually suspect that he's not even able to write down an "hello world"
application. Then Pramod wrote down a (intentionally) buggy program to
let the OP think about the problem, but I didn't realised and I
complained. You actually corrected the bugs in that code. The rule about
the homework is not a rigid "if there is code you can correct, if there
is no code you can't write anything". You should put a bit of
common-sense, which means: somebody assigned a homework to the OP in
order to let him learn something. If you want to help, you have to teach
something to that guy. The group is about sharing knowledge, not code.
So, if you can understand that the OP is not looking for knowledge, but
just for somebody that does his homework for him, you'd better not
provide him with the information he asks, that wouldn't help anybody. On
the opposite, it's disruptive for the OP.
>
When who posts is looking for information and is interested in
understanding something, you are more than welcome to help if you want
to! :)
>
>
Regards,
>
Zeppe
>
My bad - I thought the one who posted the code WAS the OP, i.e. I told
him/her the go look at the FAQ and he/she came back and posted code.
Again, my mistake. As for the hard and fast rule thing, I was simply
referring to what the FAQ says, though I do understand that there is
some human flexibility in that. As the above showed though, I have a
long way to go in fully comprehending it all. IMHO until you understand
the rules enough to know how and when to bend them, it is best to stick
by them.
DN
P.S. there is a reason I came up with my sig and used it ;)
--
[there are no x's in my email]
I have the right to remain silent
(and should probably use it as much as possible)
Anything I type can and will be used against me
in a court of idiocy
I have the right to be wrong
(and probably am)
If I can not furnish my own wrongness
I'm sure someone will provide it for me. | | | | re: How i write this program Please help me
osmium wrote: Quote:
>
To me, it was a minor screw up. I think the mistake you made was not going
back to find the original post, the one where the subject is not prefixed
with Re: on my newsreader; I think you got started in the middle of a
thread without knowing it. In case my sarcasm was too dense, or whatever,
the post you answered was a *serious* attempt to answer, and most certainly
not a "witty programmer" response, as theorized here. He (Pramod) shouldn't
have done that.
>
>
Check the response to Zeppe. But I do feel better now. I have been
reading this news group a lot lately and hold a pretty high opinion of
some of you guys (and gals?) so I was kind of concerned about having
made a major screw-up.
DN
--
[there are no x's in my email]
I have the right to remain silent
(and should probably use it as much as possible)
Anything I type can and will be used against me
in a court of idiocy
I have the right to be wrong
(and probably am)
If I can not furnish my own wrongness
I'm sure someone will provide it for me. |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,223 network members.
|