comp.lang.ada
 help / color / mirror / Atom feed
* Re: Help to translate from ADA 2 C/C++
  1996-04-08  0:00 Help to translate from ADA 2 C/C++ Robert Gelb
  1996-04-08  0:00 ` Robert Dewar
@ 1996-04-08  0:00 ` Bob Kitzberger
  1996-04-08  0:00   ` Robert Dewar
  1996-04-14  0:00 ` AJW
  2 siblings, 1 reply; 6+ messages in thread
From: Bob Kitzberger @ 1996-04-08  0:00 UTC (permalink / raw)


Robert Gelb (rgelb@csulb.edu) wrote:
: I am having a hell of a time trying to translate this ADA program into 
: C/C++.  Maybe someone can help me.

What is C/C++ ? 

: type person(sex:gender);
: type car;
: type person_name is access person;
: type car_name is access car;

Simple.  Define a class for "person".  Define two subclasses, one for
"male person" and one for "female person".  Define a class for "car",
and as many subclasses as you see fit.

Now define a class for "car-owning person", and multiply inherit
from the car class and the person class.

By now you should have a nice deep inheritance tree, with multiple
inheritance to boot ;-)  Pretty whizzy, eh?  As an added feature,
it exemplifies misuse of inheritance.

Kids, don't do this at home...

--
Bob Kitzberger	      Rational Software Corporation       rlk@rational.com




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help to translate from ADA 2 C/C++
  1996-04-08  0:00 ` Bob Kitzberger
@ 1996-04-08  0:00   ` Robert Dewar
  1996-04-13  0:00     ` Michael Feldman
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Dewar @ 1996-04-08  0:00 UTC (permalink / raw)


Sometimes when students post to newsgroups asking for help with their
assignments, I wonder if they know how easy it is to track this kind
of query. I routinely do a DejaNEWS search on what my students have
posted at the end of the semester, sometimes it is quite enlightening :-)
Incidentally, my viewpoint when students ask for help, especially if
they are reasonably open about what they are doing, is to provide
pointers to the solution, but not the solutions themselves :-)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Help to translate from ADA 2 C/C++
@ 1996-04-08  0:00 Robert Gelb
  1996-04-08  0:00 ` Robert Dewar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Robert Gelb @ 1996-04-08  0:00 UTC (permalink / raw)


I am having a hell of a time trying to translate this ADA program into 
C/C++.  Maybe someone can help me.
Here is the program:

type person(sex:gender);
type car;
type person_name is access person;
type car_name is access car;

type car is 
	record
		number: integer;
		owner: person_name;
	end record;

type person(sex:gender) is 
	record
		name	:string(1..20);
		birth	:date;
		age	:integer range 0..130;
		vehicle	: car_name;
		case sex is
			when M =>
				wife: person_name(F);
			when F =>
				husband:person_name(M);
		end case;
	end record;





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help to translate from ADA 2 C/C++
  1996-04-08  0:00 Help to translate from ADA 2 C/C++ Robert Gelb
@ 1996-04-08  0:00 ` Robert Dewar
  1996-04-08  0:00 ` Bob Kitzberger
  1996-04-14  0:00 ` AJW
  2 siblings, 0 replies; 6+ messages in thread
From: Robert Dewar @ 1996-04-08  0:00 UTC (permalink / raw)


Robert Gelb asked for help translating a little program. The post is
from an edu address, so naturally there is a question as to whether
we are being asked to help with an assignment here.

It might be a good idea if people posting this kind of request make it
clear that they are not asking for help with an assignment, and give
some idea of why they are asking the question (the latter is always
helpful information in providing the best answer in any case!)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help to translate from ADA 2 C/C++
  1996-04-08  0:00   ` Robert Dewar
@ 1996-04-13  0:00     ` Michael Feldman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Feldman @ 1996-04-13  0:00 UTC (permalink / raw)


In article <dewar.828992261@schonberg>, Robert Dewar <dewar@cs.nyu.edu> wrote:
>Sometimes when students post to newsgroups asking for help with their
>assignments, I wonder if they know how easy it is to track this kind
>of query. I routinely do a DejaNEWS search on what my students have
>posted at the end of the semester, sometimes it is quite enlightening :-)
>Incidentally, my viewpoint when students ask for help, especially if
>they are reasonably open about what they are doing, is to provide
>pointers to the solution, but not the solutions themselves :-)

I agree. We have to strike a balance between students' learning how to do
various kinds of projects, and the fact that they do not - should not,
cannot - live in a vaccuum. Programming assignments are no different 
from other kinds of graded work, or any kind of intellectual work for
that matter. 

Plagiarism is plagiarism. A student who went to the 'net for a solution, 
and documented it honestly, saying "this is the help I got from <name> 
via the <name> newsgroup" would not be slammed for plagiarism. A program is
little different from, say, a literature essay in this regard. The key
criterion is "are you taking credit for work done by others, or only
for the work you actually did?"

On the other hand, I try to establish sensible ground rules to encourage
the students to understand that outright copying - even if it's 
documented - is frowned upon, because they've cheated themselves out of 
the experience they are supposed to be getting in the course. They'll
end up getting caught on the exams, in any case.

Conclusion:      

1. I get paid to be a teacher, not a policeman. A really skillful
   cheater will get away with it; that's life. The dumb ones get
   nailed, just like in real life. I will prosecute those cases 
   that come to my attention and that I can win; I let students know 
   this, and I've won a few rather visible cases. They know the risk.

2. Part of my role as a teacher is to instill in my students a
   respect for a principle of intellectual honesty - take credit
   where it is appropriate; give credit where it is due.

(2) is really more important than (1). Teaching honesty is more
important than "stamping out crime."

Mike Feldman




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Help to translate from ADA 2 C/C++
  1996-04-08  0:00 Help to translate from ADA 2 C/C++ Robert Gelb
  1996-04-08  0:00 ` Robert Dewar
  1996-04-08  0:00 ` Bob Kitzberger
@ 1996-04-14  0:00 ` AJW
  2 siblings, 0 replies; 6+ messages in thread
From: AJW @ 1996-04-14  0:00 UTC (permalink / raw)


What? Having trouble translating what appears to be a simple type declaration
in ADA to C/C++ ? Someone needs to read two books "ADA for the Beginner" and 
Teach yourself C/C++ in 21 days". I know the answer to this can be figured out 
using these books. (or then again maybe its in someones text books?)






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1996-04-14  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-08  0:00 Help to translate from ADA 2 C/C++ Robert Gelb
1996-04-08  0:00 ` Robert Dewar
1996-04-08  0:00 ` Bob Kitzberger
1996-04-08  0:00   ` Robert Dewar
1996-04-13  0:00     ` Michael Feldman
1996-04-14  0:00 ` AJW

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox