Academic Advice (Professionals only Please)

R

Robocop

Dear Folks:
I would extremely appreciate your advices, as it would help me make my
decisions. Please spare some time to read the following.
Here is what happened with me. We had to do an assignment worth only
2%. In it we had to make 7 classes one of them is below.
After spending hours I completed the entire assgn. and I had a little
bug in one of the class given below, so I decided to go to a forum.
There we discussed the problem and one person gave the code GIVEN
BELOW. So I ran it with my other classes and it worked, when I looked
at the code written by the person from the forum I quickly realized
what the _mistake_ in my code was and what changes it needed, as that
mistake was pretty much "trivial" and mediocre; I didn't bother to
correct that mistake in my code and I sent the code from the forum
given below as according to me it was no big deal as no one was ever
going to SEE the code and mark it and also the implementation of the
method in the code given by the person in the forum was pretty good
and no. of lines were few compared to MINE so I favored that code and
NOT mine . Moreover, the code was ONLY going to be marked by a
"TESTDRIVER" AUTOMATICALLY based on the OUTPUTS of the methods.
If you look at the code below (from the forum) and the one after it
(MINE). BOTH the codes will give SAME OUTPUTS if tested by the
TESTDRIVER, so it doesn't matter which code I used.
I've ALSO POSTED THE "method" (at the bottom) in the class written by
me which compelled me to take OUTSIDE HELP.

Now I am charged with >>>"ACADEMIC DISHONESTY"<<< I don't know what to
do now. I thinks its just laughable to be charged for such simple
thing; also me being a first year student, I don't think its fair.

FOR 2% THIS MUCH? I have to lose 5% now because of this.
There were 7 classes and just due to ONE METHOD which accounts to
about 0.2% of the entire assignment.!!!

SO, for thing of 0.2% I've to LOSE 5%????

I could have avoided this whole thing had I known that "we have to add
the name and the address of the reference" from where the segment of
the class was taken from. But being a NOVICE I wasn't aware.
I had with the people in the FORUM and the few things I said about the
INSTITUTION.



SHOULD I GO FOR A FORMAL HEARING IN FRONT OF LOT MORE PEOPLE TO PROVE
MYSELF INNOCENT OR SHOULD I ACCEPT THE CHARGES AND PLEAD *GUILTY* AND
ACCEPT 5% DECREASE IN MY OVERALL RESULT???

PLEASE ADVICE.

/* Folowing is the code that I got from the FORUM*/

import java.util.Collection;
import java.util.ArrayList;
import java.util.Iterator;

public class Train {
public static final String BERTH = "berth";
public static final String SEAT = "seat";

private Collection railCars = new ArrayList();

// yuck.
public Train(int numSaloonCars, int nSeats, int numSleepingCars,
int nBerths) {

if (numSaloonCars < 0 || nSeats < 0 || numSleepingCars < 0 ||
nBerths < 0)
throw new IllegalArgumentException("No values less than
zero allowed");
if (numSaloonCars + numSleepingCars == 0)
throw new IllegalArgumentException("Gotta have railCars,
baby");
if (nSeats > SaloonCar.MAX_SEATS)
throw new IllegalArgumentException("Too many seats");
if (nBerths > SleepingCar.MAX_BERTHS)
throw new IllegalArgumentException("Too many berths");

railCars = new ArrayList();

for (int i = 0; i < numSaloonCars; i++) {
SaloonCar car = new SaloonCar(nSeats);
railCars.add(car);
}

for (int i = 0; i < numSleepingCars; i++) {
SleepingCar car = new SleepingCar(nBerths);
railCars.add(car);
}
}
// double yuck.
/*RELEVANT PART <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public String reserveSpace(String spaceType, int numP) throws
TrainFullException {

if (!spaceType.equals(SEAT) && !spaceType.equals(BERTH))
throw new IllegalArgumentException("invalid spacetype");
if (numP < 1) throw new IllegalArgumentException("numP must be

Iterator cars = railCars.iterator();

while (cars.hasNext()) {
RailCar car = (RailCar) cars.next();
if ( (spaceType.equals(SEAT) && car instanceof SaloonCar)
||
(spaceType.equals(BERTH) && car instanceof
SleepingCar) ) {
if (car.getAvailableSpace() >= numP) {
try {
return car.addPassengers(numP);
} catch (CarFullException cfe ) { /* not gonna
happen */ }
}
}
}
// if we get here, nothing's been allocated, so...
throw new TrainFullException();
}
public String toString() {
StringBuffer buf = new StringBuffer("Train[");
Iterator cars = railCars.iterator();
int count = 0;
while (cars.hasNext()) {
if (count++ > 0) buf.append(",");
buf.append(cars.next());
}
return buf.append("]").toString();
}

}




****FOLLOWING IS CODE WRITTEN BY ME, AFTER REVIEWING THE ABOVE CODE, I
JUST NEED TO ADDED >TRY AND CATCH< BLOCKS.
public class Train {

public Train(int numSaloonCars, int nSeats, int numSleepingCars,
int nBerths) {

if((numSaloonCars + numSleepingCars) <= 0
|| (nSeats + nBerths) <= 0 || numSaloonCars < 0 ||
numSleepingCars < 0) {
throw new IllegalArgumentException("input valid data!");
} else {
for(int i = 0; i < numSaloonCars; i++) {
atotal.add(new SaloonCar(nSeats));
}

for(int m = 0; m < numSleepingCars; m++) {
btotal.add(new SleepingCar(nBerths));
}
}
}
/* RELEVANT PART<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public String reserveSpace(String spaceType, int numP) {

StringBuffer buf = new StringBuffer();

if(( !spaceType.equals(BERTH) && !spaceType.equals(SEAT))
|| (numP <= 0)) {
throw new IllegalArgumentException("enter proper data!");
} else if(spaceType.equals(SEAT)) {
List train = new LinkedList(atotal);
int found = 0;

for(int i = 0; i < train.size(); i++) {

if(((SaloonCar) train.get(i)).getAvailableSpace()>=
numP)
{
found = i;
}

}
try{
buf.append(((SaloonCar)
train.get(found)).addPassengers(numP));
} catch (CarFullException e) {throw new
TrainFullException();}

}
else if(spaceType.equals(BERTH)) {
List train2 = new LinkedList(btotal);
int found2 = 0;
for(int m = 0; m < train2.size(); m++) {
if( ((SleepingCar) train2.get(m)).getAvailableSpace()
{
found2 = m;
}
}
try{
buf.append(((SleepingCar)
train2.get(found2)).addPassengers(numP));
} catch (CarFullException e) {throw new TrainFullException();}

}


return buf.toString();
}
*/

public String toString() {

StringBuffer buf = new StringBuffer("Train [");
List list = new LinkedList(atotal);
List list2 = new LinkedList(btotal);

for(int i = 0; i < list.size(); i++) {
buf.append(" SaloonCar[ ");
buf.append(((SaloonCar) list.get(i)).toString() + " ]");
}

for(int m = 0; m < list2.size(); m++) {
buf.append(" SleepingCar[ ");
buf.append(((SleepingCar) list2.get(m)).toString() + "
]");
}

return buf.toString();
}

private List atotal = new LinkedList();
private List btotal = new LinkedList();
public static final String BERTH = "berth";
public static final String SEAT = "seat";
}
//////////////////////////////////////////////////////////////////////

/*BELOW IS THE CODE WRITTEN BY ME *BEFORE* GOING TO THE FORUM*/
YOU CAN NOTICE THE ONLY ADDITION IS THE "TRY AND CATCH" BLOCKS.

public String reserveSpace(String spaceType, int numP) {

StringBuffer buf = new StringBuffer();

if(( !spaceType.equals(BERTH) && !spaceType.equals(SEAT))
|| (numP <= 0)) {
throw new IllegalArgumentException("enter proper data!");
} else if(spaceType.equals(SEAT)) {
List train = new LinkedList(atotal);

for(int i = 0; i < train.size(); i++) {
if(numP == ((SaloonCar)
train.get(i)).getAvailableSpace()) {
buf.append(
((SaloonCar)
train.get(i)).addPassengers(numP));
} else if(numP
< ((SaloonCar)
train.get(i)).getAvailableSpace()) {
buf.append(((RailCar)
train.get(i)).addPassengers(numP));
} else {
throw new TrainFullException("Train's Full!");
}
}
} else if(spaceType.equals(BERTH)) {
List train2 = new LinkedList(btotal);

for(int m = 0; m < train2.size(); m++) {
if(numP == ((SleepingCar) train2.get(
m)).getAvailableSpace()) {
buf.append(
((SleepingCar)
train2.get(m)).addPassengers(numP));
} else if(numP
< ((SleepingCar) train2.get(
m)).getAvailableSpace()) {
buf.append(
((SleepingCar)
train2.get(m)).addPassengers(numP));
} else {
throw new TrainFullException("Train's Full!");
}
}
}

return buf.toString();
}
 
A

Andrew Thompson

Re: Academic Advice (Professionals only Please)

So you don't want to hear from other students,
or yobs like me that don't 'earn a living'
from Java. Tough, you get what you get.
...
Please keep posts on topic.
..so I decided to go to a forum.

What forum? I can see no evidence of the thread
you refer to in the posts you have made here..
<http://www.google.com/groups?q=robocop+train&group=comp.lang.java.programmer>

So, we now have this conversation is about..
a) Academic misconduct, which, actual or imagined,
is off topic for this forum. (though their may be some
justification for it to be diuscussed on c.l.j.help)
b) In reference to a conversation that did not
occur here and to which you did not link.

I suggest you take it back to the group on which
it occured..
 
L

Liz

One time I was a student and found the answer to
one of my homework problems in a book. I told the
teacher and asked if I could just copy it. He said ok.
I started to write it out and then thought that this
is too time consuming, so I Xeroxed it. He was pissed,
but since he said ok first, he gave me a full 10 points.

You should have known that teachers nowadays are
checking for student cheating via the computer.
It has been on TV even. You are guilty. Take your punishment.
Consider it a cost of learning something. If you argue,
you have not yet learned this lesson.


Robocop said:
Dear Folks:
I would extremely appreciate your advices, as it would help me make my
decisions. Please spare some time to read the following.
Here is what happened with me. We had to do an assignment worth only
2%. In it we had to make 7 classes one of them is below.
After spending hours I completed the entire assgn. and I had a little
bug in one of the class given below, so I decided to go to a forum.
There we discussed the problem and one person gave the code GIVEN
BELOW. So I ran it with my other classes and it worked, when I looked
at the code written by the person from the forum I quickly realized
what the _mistake_ in my code was and what changes it needed, as that
mistake was pretty much "trivial" and mediocre; I didn't bother to
correct that mistake in my code and I sent the code from the forum
given below as according to me it was no big deal as no one was ever
going to SEE the code and mark it and also the implementation of the
method in the code given by the person in the forum was pretty good
and no. of lines were few compared to MINE so I favored that code and
NOT mine . Moreover, the code was ONLY going to be marked by a
"TESTDRIVER" AUTOMATICALLY based on the OUTPUTS of the methods.
If you look at the code below (from the forum) and the one after it
(MINE). BOTH the codes will give SAME OUTPUTS if tested by the
TESTDRIVER, so it doesn't matter which code I used.
I've ALSO POSTED THE "method" (at the bottom) in the class written by
me which compelled me to take OUTSIDE HELP.

Now I am charged with >>>"ACADEMIC DISHONESTY"<<< I don't know what to
do now. I thinks its just laughable to be charged for such simple
thing; also me being a first year student, I don't think its fair.

FOR 2% THIS MUCH? I have to lose 5% now because of this.
There were 7 classes and just due to ONE METHOD which accounts to
about 0.2% of the entire assignment.!!!

SO, for thing of 0.2% I've to LOSE 5%????

I could have avoided this whole thing had I known that "we have to add
the name and the address of the reference" from where the segment of
the class was taken from. But being a NOVICE I wasn't aware.
I had with the people in the FORUM and the few things I said about the
INSTITUTION.



SHOULD I GO FOR A FORMAL HEARING IN FRONT OF LOT MORE PEOPLE TO PROVE
MYSELF INNOCENT OR SHOULD I ACCEPT THE CHARGES AND PLEAD *GUILTY* AND
ACCEPT 5% DECREASE IN MY OVERALL RESULT???

PLEASE ADVICE.

/* Folowing is the code that I got from the FORUM*/

import java.util.Collection;
import java.util.ArrayList;
import java.util.Iterator;

public class Train {
public static final String BERTH = "berth";
public static final String SEAT = "seat";

private Collection railCars = new ArrayList();

// yuck.
public Train(int numSaloonCars, int nSeats, int numSleepingCars,
int nBerths) {

if (numSaloonCars < 0 || nSeats < 0 || numSleepingCars < 0 ||
nBerths < 0)
throw new IllegalArgumentException("No values less than
zero allowed");
if (numSaloonCars + numSleepingCars == 0)
throw new IllegalArgumentException("Gotta have railCars,
baby");
if (nSeats > SaloonCar.MAX_SEATS)
throw new IllegalArgumentException("Too many seats");
if (nBerths > SleepingCar.MAX_BERTHS)
throw new IllegalArgumentException("Too many berths");

railCars = new ArrayList();

for (int i = 0; i < numSaloonCars; i++) {
SaloonCar car = new SaloonCar(nSeats);
railCars.add(car);
}

for (int i = 0; i < numSleepingCars; i++) {
SleepingCar car = new SleepingCar(nBerths);
railCars.add(car);
}
}
// double yuck.
/*RELEVANT PART <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public String reserveSpace(String spaceType, int numP) throws
TrainFullException {

if (!spaceType.equals(SEAT) && !spaceType.equals(BERTH))
throw new IllegalArgumentException("invalid spacetype");
if (numP < 1) throw new IllegalArgumentException("numP must be

Iterator cars = railCars.iterator();

while (cars.hasNext()) {
RailCar car = (RailCar) cars.next();
if ( (spaceType.equals(SEAT) && car instanceof SaloonCar)
||
(spaceType.equals(BERTH) && car instanceof
SleepingCar) ) {
if (car.getAvailableSpace() >= numP) {
try {
return car.addPassengers(numP);
} catch (CarFullException cfe ) { /* not gonna
happen */ }
}
}
}
// if we get here, nothing's been allocated, so...
throw new TrainFullException();
}
public String toString() {
StringBuffer buf = new StringBuffer("Train[");
Iterator cars = railCars.iterator();
int count = 0;
while (cars.hasNext()) {
if (count++ > 0) buf.append(",");
buf.append(cars.next());
}
return buf.append("]").toString();
}

}




****FOLLOWING IS CODE WRITTEN BY ME, AFTER REVIEWING THE ABOVE CODE, I
JUST NEED TO ADDED >TRY AND CATCH< BLOCKS.
public class Train {

public Train(int numSaloonCars, int nSeats, int numSleepingCars,
int nBerths) {

if((numSaloonCars + numSleepingCars) <= 0
|| (nSeats + nBerths) <= 0 || numSaloonCars < 0 ||
numSleepingCars < 0) {
throw new IllegalArgumentException("input valid data!");
} else {
for(int i = 0; i < numSaloonCars; i++) {
atotal.add(new SaloonCar(nSeats));
}

for(int m = 0; m < numSleepingCars; m++) {
btotal.add(new SleepingCar(nBerths));
}
}
}
/* RELEVANT PART<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public String reserveSpace(String spaceType, int numP) {

StringBuffer buf = new StringBuffer();

if(( !spaceType.equals(BERTH) && !spaceType.equals(SEAT))
|| (numP <= 0)) {
throw new IllegalArgumentException("enter proper data!");
} else if(spaceType.equals(SEAT)) {
List train = new LinkedList(atotal);
int found = 0;

for(int i = 0; i < train.size(); i++) {

if(((SaloonCar) train.get(i)).getAvailableSpace()>=
numP)
{
found = i;
}

}
try{
buf.append(((SaloonCar)
train.get(found)).addPassengers(numP));
} catch (CarFullException e) {throw new
TrainFullException();}

}
else if(spaceType.equals(BERTH)) {
List train2 = new LinkedList(btotal);
int found2 = 0;
for(int m = 0; m < train2.size(); m++) {
if( ((SleepingCar) train2.get(m)).getAvailableSpace()
{
found2 = m;
}
}
try{
buf.append(((SleepingCar)
train2.get(found2)).addPassengers(numP));
} catch (CarFullException e) {throw new TrainFullException();}

}


return buf.toString();
}
*/

public String toString() {

StringBuffer buf = new StringBuffer("Train [");
List list = new LinkedList(atotal);
List list2 = new LinkedList(btotal);

for(int i = 0; i < list.size(); i++) {
buf.append(" SaloonCar[ ");
buf.append(((SaloonCar) list.get(i)).toString() + " ]");
}

for(int m = 0; m < list2.size(); m++) {
buf.append(" SleepingCar[ ");
buf.append(((SleepingCar) list2.get(m)).toString() + "
]");
}

return buf.toString();
}

private List atotal = new LinkedList();
private List btotal = new LinkedList();
public static final String BERTH = "berth";
public static final String SEAT = "seat";
}
//////////////////////////////////////////////////////////////////////

/*BELOW IS THE CODE WRITTEN BY ME *BEFORE* GOING TO THE FORUM*/
YOU CAN NOTICE THE ONLY ADDITION IS THE "TRY AND CATCH" BLOCKS.

public String reserveSpace(String spaceType, int numP) {

StringBuffer buf = new StringBuffer();

if(( !spaceType.equals(BERTH) && !spaceType.equals(SEAT))
|| (numP <= 0)) {
throw new IllegalArgumentException("enter proper data!");
} else if(spaceType.equals(SEAT)) {
List train = new LinkedList(atotal);

for(int i = 0; i < train.size(); i++) {
if(numP == ((SaloonCar)
train.get(i)).getAvailableSpace()) {
buf.append(
((SaloonCar)
train.get(i)).addPassengers(numP));
} else if(numP
< ((SaloonCar)
train.get(i)).getAvailableSpace()) {
buf.append(((RailCar)
train.get(i)).addPassengers(numP));
} else {
throw new TrainFullException("Train's Full!");
}
}
} else if(spaceType.equals(BERTH)) {
List train2 = new LinkedList(btotal);

for(int m = 0; m < train2.size(); m++) {
if(numP == ((SleepingCar) train2.get(
m)).getAvailableSpace()) {
buf.append(
((SleepingCar)
train2.get(m)).addPassengers(numP));
} else if(numP
< ((SleepingCar) train2.get(
m)).getAvailableSpace()) {
buf.append(
((SleepingCar)
train2.get(m)).addPassengers(numP));
} else {
throw new TrainFullException("Train's Full!");
}
}
}

return buf.toString();
}
 
T

Thomas G. Marshall

Calmly fight it.

But I suspect that your reason for posting it here was so that your
professor could read your complaint.

But just calmly, and relentlessly, fight it.
 
A

Adam Maass

Robocop said:
Dear Folks:

I would extremely appreciate your advices, as it would help me make my
decisions. Please spare some time to read the following.
Here is what happened with me. We had to do an assignment worth only
2%. In it we had to make 7 classes one of them is below.
After spending hours I completed the entire assgn. and I had a little
bug in one of the class given below, so I decided to go to a forum.
There we discussed the problem and one person gave the code GIVEN
BELOW. So I ran it with my other classes and it worked, when I looked
at the code written by the person from the forum I quickly realized
what the _mistake_ in my code was and what changes it needed, as that
mistake was pretty much "trivial" and mediocre; I didn't bother to
correct that mistake in my code and I sent the code from the forum
given below as according to me it was no big deal as no one was ever
going to SEE the code and mark it and also the implementation of the
method in the code given by the person in the forum was pretty good
and no. of lines were few compared to MINE so I favored that code and
NOT mine . Moreover, the code was ONLY going to be marked by a
"TESTDRIVER" AUTOMATICALLY based on the OUTPUTS of the methods.
If you look at the code below (from the forum) and the one after it
(MINE). BOTH the codes will give SAME OUTPUTS if tested by the
TESTDRIVER, so it doesn't matter which code I used.
I've ALSO POSTED THE "method" (at the bottom) in the class written by
me which compelled me to take OUTSIDE HELP.

Now I am charged with >>>"ACADEMIC DISHONESTY"<<< I don't know what to
do now.

The academic world works a lot differently than the professional world.

In the professional world, what you did would be perfectly acceptable and
indeed, even preferable: you found a way to answer the problem posed, and
probably saved a good amount of time rather than trying to figure it out for
yourself.

But in the academic world, the point is not to solve the problem, but to
learn how to solve problems.

My recommendation: take your lumps. You'll be in the academic world for some
time to come; you need to know how it operates.


One guideline I've seen posted about academic honesty in computer science
courses: students may talk about the problems, may even point out where
mistakes are in other students' code. But students may not actually write or
modify other students' code.

-- Adam Maass
 
H

Hamilcar Barca

I didn't bother to correct that mistake in my code and I sent the
code from the forum
[...]
Now I am charged with >>>"ACADEMIC DISHONESTY"<<<

It's called "plagiarism". You used somebody else's work without crediting
it.
I could have avoided this whole thing had I known that "we have to add
the name and the address of the reference" from where the segment of the
class was taken from. But being a NOVICE I wasn't aware.

You should have known. Now you do. Ignorance of academic requirements
has never been a valid excuse.
SHOULD I GO FOR A FORMAL HEARING

HELL NO.
PLEASE ADVICE.

TAKE YOUR LUMPS AND GET ON WITH LIFE.
 
H

Hal Rosser

bite the bullet
discussing code strategy is 'ok'
but you cross the line when someone is looking at your code - or you are
copying other's code.
Looking at other's code which is publicly available gives you an opportunity
to look at it, and to try to understand it.
then use the lessons learned (not the actual code)
The academic environment encourages learning and thinking for yourself - not
having others to do it for you.
After you graduate - the constraints are lifted.
my 2-cents



Robocop said:
Dear Folks:
I would extremely appreciate your advices, as it would help me make my
decisions. Please spare some time to read the following.
Here is what happened with me. We had to do an assignment worth only
2%. In it we had to make 7 classes one of them is below.
After spending hours I completed the entire assgn. and I had a little
bug in one of the class given below, so I decided to go to a forum.
There we discussed the problem and one person gave the code GIVEN
BELOW. So I ran it with my other classes and it worked, when I looked
at the code written by the person from the forum I quickly realized
what the _mistake_ in my code was and what changes it needed, as that
mistake was pretty much "trivial" and mediocre; I didn't bother to
correct that mistake in my code and I sent the code from the forum
given below as according to me it was no big deal as no one was ever
going to SEE the code and mark it and also the implementation of the
method in the code given by the person in the forum was pretty good
and no. of lines were few compared to MINE so I favored that code and
NOT mine . Moreover, the code was ONLY going to be marked by a
"TESTDRIVER" AUTOMATICALLY based on the OUTPUTS of the methods.
If you look at the code below (from the forum) and the one after it
(MINE). BOTH the codes will give SAME OUTPUTS if tested by the
TESTDRIVER, so it doesn't matter which code I used.
I've ALSO POSTED THE "method" (at the bottom) in the class written by
me which compelled me to take OUTSIDE HELP.

Now I am charged with >>>"ACADEMIC DISHONESTY"<<< I don't know what to
do now. I thinks its just laughable to be charged for such simple
thing; also me being a first year student, I don't think its fair.

FOR 2% THIS MUCH? I have to lose 5% now because of this.
There were 7 classes and just due to ONE METHOD which accounts to
about 0.2% of the entire assignment.!!!

SO, for thing of 0.2% I've to LOSE 5%????

I could have avoided this whole thing had I known that "we have to add
the name and the address of the reference" from where the segment of
the class was taken from. But being a NOVICE I wasn't aware.
I had with the people in the FORUM and the few things I said about the
INSTITUTION.



SHOULD I GO FOR A FORMAL HEARING IN FRONT OF LOT MORE PEOPLE TO PROVE
MYSELF INNOCENT OR SHOULD I ACCEPT THE CHARGES AND PLEAD *GUILTY* AND
ACCEPT 5% DECREASE IN MY OVERALL RESULT???

PLEASE ADVICE.

/* Folowing is the code that I got from the FORUM*/

import java.util.Collection;
import java.util.ArrayList;
import java.util.Iterator;

public class Train {
public static final String BERTH = "berth";
public static final String SEAT = "seat";

private Collection railCars = new ArrayList();

// yuck.
public Train(int numSaloonCars, int nSeats, int numSleepingCars,
int nBerths) {

if (numSaloonCars < 0 || nSeats < 0 || numSleepingCars < 0 ||
nBerths < 0)
throw new IllegalArgumentException("No values less than
zero allowed");
if (numSaloonCars + numSleepingCars == 0)
throw new IllegalArgumentException("Gotta have railCars,
baby");
if (nSeats > SaloonCar.MAX_SEATS)
throw new IllegalArgumentException("Too many seats");
if (nBerths > SleepingCar.MAX_BERTHS)
throw new IllegalArgumentException("Too many berths");

railCars = new ArrayList();

for (int i = 0; i < numSaloonCars; i++) {
SaloonCar car = new SaloonCar(nSeats);
railCars.add(car);
}

for (int i = 0; i < numSleepingCars; i++) {
SleepingCar car = new SleepingCar(nBerths);
railCars.add(car);
}
}
// double yuck.
/*RELEVANT PART <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public String reserveSpace(String spaceType, int numP) throws
TrainFullException {

if (!spaceType.equals(SEAT) && !spaceType.equals(BERTH))
throw new IllegalArgumentException("invalid spacetype");
if (numP < 1) throw new IllegalArgumentException("numP must be

Iterator cars = railCars.iterator();

while (cars.hasNext()) {
RailCar car = (RailCar) cars.next();
if ( (spaceType.equals(SEAT) && car instanceof SaloonCar)
||
(spaceType.equals(BERTH) && car instanceof
SleepingCar) ) {
if (car.getAvailableSpace() >= numP) {
try {
return car.addPassengers(numP);
} catch (CarFullException cfe ) { /* not gonna
happen */ }
}
}
}
// if we get here, nothing's been allocated, so...
throw new TrainFullException();
}
public String toString() {
StringBuffer buf = new StringBuffer("Train[");
Iterator cars = railCars.iterator();
int count = 0;
while (cars.hasNext()) {
if (count++ > 0) buf.append(",");
buf.append(cars.next());
}
return buf.append("]").toString();
}

}




****FOLLOWING IS CODE WRITTEN BY ME, AFTER REVIEWING THE ABOVE CODE, I
JUST NEED TO ADDED >TRY AND CATCH< BLOCKS.
public class Train {

public Train(int numSaloonCars, int nSeats, int numSleepingCars,
int nBerths) {

if((numSaloonCars + numSleepingCars) <= 0
|| (nSeats + nBerths) <= 0 || numSaloonCars < 0 ||
numSleepingCars < 0) {
throw new IllegalArgumentException("input valid data!");
} else {
for(int i = 0; i < numSaloonCars; i++) {
atotal.add(new SaloonCar(nSeats));
}

for(int m = 0; m < numSleepingCars; m++) {
btotal.add(new SleepingCar(nBerths));
}
}
}
/* RELEVANT PART<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public String reserveSpace(String spaceType, int numP) {

StringBuffer buf = new StringBuffer();

if(( !spaceType.equals(BERTH) && !spaceType.equals(SEAT))
|| (numP <= 0)) {
throw new IllegalArgumentException("enter proper data!");
} else if(spaceType.equals(SEAT)) {
List train = new LinkedList(atotal);
int found = 0;

for(int i = 0; i < train.size(); i++) {

if(((SaloonCar) train.get(i)).getAvailableSpace()>=
numP)
{
found = i;
}

}
try{
buf.append(((SaloonCar)
train.get(found)).addPassengers(numP));
} catch (CarFullException e) {throw new
TrainFullException();}

}
else if(spaceType.equals(BERTH)) {
List train2 = new LinkedList(btotal);
int found2 = 0;
for(int m = 0; m < train2.size(); m++) {
if( ((SleepingCar) train2.get(m)).getAvailableSpace()
{
found2 = m;
}
}
try{
buf.append(((SleepingCar)
train2.get(found2)).addPassengers(numP));
} catch (CarFullException e) {throw new TrainFullException();}

}


return buf.toString();
}
*/

public String toString() {

StringBuffer buf = new StringBuffer("Train [");
List list = new LinkedList(atotal);
List list2 = new LinkedList(btotal);

for(int i = 0; i < list.size(); i++) {
buf.append(" SaloonCar[ ");
buf.append(((SaloonCar) list.get(i)).toString() + " ]");
}

for(int m = 0; m < list2.size(); m++) {
buf.append(" SleepingCar[ ");
buf.append(((SleepingCar) list2.get(m)).toString() + "
]");
}

return buf.toString();
}

private List atotal = new LinkedList();
private List btotal = new LinkedList();
public static final String BERTH = "berth";
public static final String SEAT = "seat";
}
//////////////////////////////////////////////////////////////////////

/*BELOW IS THE CODE WRITTEN BY ME *BEFORE* GOING TO THE FORUM*/
YOU CAN NOTICE THE ONLY ADDITION IS THE "TRY AND CATCH" BLOCKS.

public String reserveSpace(String spaceType, int numP) {

StringBuffer buf = new StringBuffer();

if(( !spaceType.equals(BERTH) && !spaceType.equals(SEAT))
|| (numP <= 0)) {
throw new IllegalArgumentException("enter proper data!");
} else if(spaceType.equals(SEAT)) {
List train = new LinkedList(atotal);

for(int i = 0; i < train.size(); i++) {
if(numP == ((SaloonCar)
train.get(i)).getAvailableSpace()) {
buf.append(
((SaloonCar)
train.get(i)).addPassengers(numP));
} else if(numP
< ((SaloonCar)
train.get(i)).getAvailableSpace()) {
buf.append(((RailCar)
train.get(i)).addPassengers(numP));
} else {
throw new TrainFullException("Train's Full!");
}
}
} else if(spaceType.equals(BERTH)) {
List train2 = new LinkedList(btotal);

for(int m = 0; m < train2.size(); m++) {
if(numP == ((SleepingCar) train2.get(
m)).getAvailableSpace()) {
buf.append(
((SleepingCar)
train2.get(m)).addPassengers(numP));
} else if(numP
< ((SleepingCar) train2.get(
m)).getAvailableSpace()) {
buf.append(
((SleepingCar)
train2.get(m)).addPassengers(numP));
} else {
throw new TrainFullException("Train's Full!");
}
}
}

return buf.toString();
}
 
D

Damian Carrillo

Dear Folks:

I would extremely appreciate your advices, as it would help me make my
decisions. Please spare some time to read the following.
Here is what happened with me. We had to do an assignment worth only
2%. In it we had to make 7 classes one of them is below.
After spending hours I completed the entire assgn. and I had a little
bug in one of the class given below, so I decided to go to a forum.
There we discussed the problem and one person gave the code GIVEN

I'm a student too, so I know where you are coming from. Did the
person who helped you know that he was helping you with an assignment, and
if so, did you comment the code and say who it was authored by, or that it
at least was not your original work. I've done this many times, where I
take code snippets from here or there and I give them credit if I know
whow the author is or at least put where I got it from.

If you can answer yes to both of the above questions, I would say you
should fight it and have a good chance of having the issue dropped.
That's how coding works in real life, right? Otherwise, I'd say it is
academic dishonesty and you should be lucky that you are getting such a
small punishment. They've kicked people out of the univ. I'm from for
stuff like that.
 
P

Phlip

Robocop said:
Now I am charged with >>>"ACADEMIC DISHONESTY"<<< I don't know what to
do now. I thinks its just laughable to be charged for such simple
thing; also me being a first year student, I don't think its fair.

You will go far in the corporate world.
 
V

Vincent Cantin

PLEASE REPLY I WOULD REALLY BE THANKFUL <<

Ok, thank me for what I will say ...
I would extremely appreciate your advices

My only advice is :
If you think that your teacher is wrong, then it is your opinion. Why do you
ask the opinion of the others ? It won't change anything. Do you have your
own personality ? Do you really have doubts ?? Don't wait that the other act
or think for you.

karma

Ps: this forum is not related to fights between teachers and students.
 
J

jenniferyiu

the academic result is not a big deal, if you are not going to have
the 1st honour.

No one like to care about how many academic grade point you gott
exactly, just would like to care about how you are going to solve a
problem, if you are able to solve a problem, how much time you use to
complete this or how much energy you would like to contribute to solve
a problem if you are going to work in IT in technical positions, or
engineering posts.

or ... IT job vacancies are moving to India and China, and you would
not work in any jobs related IT field after your graduation .....
 
F

FISH

(e-mail address removed) (Robocop) wrote in message
[snipped...]
I didn't bother to
correct that mistake in my code and I sent the code from the forum
given below as according to me it was no big deal as no one was ever
going to SEE the code and mark it and also the implementation of the
method in the code given by the person in the forum was pretty good
and no. of lines were few compared to MINE so I favored that code and
NOT mine .


In other words the code from the forum was superior to your own.
Not only did it work, but it was better written and more efficient.

If you'd simply studied the forum code, realised your mistake and
corrected your own work, perhaps then I might have some sympathy
for you. Your teacher is less interested in what your code does,
more *how* it does it - the *how* is what he/she is actually trying
to teach you. Not asking for the source code does not mean you're
free to copy. If you are struggling to design your own handglider,
and someone shows you the plans to a jet aircraft, you cannot simply
claim the jet plane as your own merely because it also happens to be
a winged flying machine. ;-)


-FISH- ><>
 
T

Thomas G. Marshall

Anon Amous said:
Of course their is nothing wrong with plagiarism, ask M$,


Not sure if your statement was limited to this, but regardling the notion of
MS copying Apple:

Many of the ideas implemented on both sides have been around a lonnnnng
time. Consider that it's possible that perhaps MS has a more difficult time
implementing anything, because of how far back they have to reach with their
compatibility to prior revs.

Not to defend them everywhere of course. I myself call them /MafiaSoft/. :)
 
D

Darrell Grainger

Dear Folks:

I would extremely appreciate your advices, as it would help me make my
decisions. Please spare some time to read the following.
Here is what happened with me. We had to do an assignment worth only
2%. In it we had to make 7 classes one of them is below.
After spending hours I completed the entire assgn. and I had a little
bug in one of the class given below, so I decided to go to a forum.
There we discussed the problem and one person gave the code GIVEN
BELOW. So I ran it with my other classes and it worked, when I looked
at the code written by the person from the forum I quickly realized
what the _mistake_ in my code was and what changes it needed, as that
mistake was pretty much "trivial" and mediocre; I didn't bother to
correct that mistake in my code and I sent the code from the forum
given below as according to me it was no big deal as no one was ever
going to SEE the code and mark it and also the implementation of the
method in the code given by the person in the forum was pretty good
and no. of lines were few compared to MINE so I favored that code and
NOT mine . Moreover, the code was ONLY going to be marked by a
"TESTDRIVER" AUTOMATICALLY based on the OUTPUTS of the methods.
If you look at the code below (from the forum) and the one after it
(MINE). BOTH the codes will give SAME OUTPUTS if tested by the
TESTDRIVER, so it doesn't matter which code I used.
I've ALSO POSTED THE "method" (at the bottom) in the class written by
me which compelled me to take OUTSIDE HELP.

Now I am charged with >>>"ACADEMIC DISHONESTY"<<< I don't know what to
do now. I thinks its just laughable to be charged for such simple
thing; also me being a first year student, I don't think its fair.

Did you hand the other person's code in and mislead or openly claim that
it was your code? If you did then you where being dishonest.

If on the other hand you openly stated what you have told us here. If the
school was aware you were using someone else's code then you were not
dishonest.
FOR 2% THIS MUCH? I have to lose 5% now because of this.
There were 7 classes and just due to ONE METHOD which accounts to
about 0.2% of the entire assignment.!!!

SO, for thing of 0.2% I've to LOSE 5%????

No, you would not lose 5% for something really worth 0.2%. You would lose
5% for being dishonest. You seem to be failing to see things from the
school's point of view. They want honesty.

If an employee came to me and said, "I found this piece of code in the
Internet and it does exactly what we want. I am going to use it rather
than re-invent the code." I'd be okay with that (assuming the code was not
copyrighted). If on the other hand an employee was getting solutions from
the Internet and claiming to have created them, I'd have a problem with
that. I want to know I can trust my employees.
I could have avoided this whole thing had I known that "we have to add
the name and the address of the reference" from where the segment of
the class was taken from. But being a NOVICE I wasn't aware.

Live and learn. Everyone makes mistakes. The important thing is to learn
from them. If you attempt to fight this you will probably have to prove
that no one made you aware of the rules. Did you receive them and fail to
read it? The university I attended put this information in the book used
for picking your program and courses. The fact that I signed up for
courses meant I had the book with the codes. I would not be able to claim
ignorance on the issue of plagiarism.
I had with the people in the FORUM and the few things I said about the
INSTITUTION.

SHOULD I GO FOR A FORMAL HEARING IN FRONT OF LOT MORE PEOPLE TO PROVE
MYSELF INNOCENT OR SHOULD I ACCEPT THE CHARGES AND PLEAD *GUILTY* AND
ACCEPT 5% DECREASE IN MY OVERALL RESULT???

You have to do what is best for you. What are the consequence of a formal
hearing? I have seen someone who was obviously guilty of plagiarism deny
it to the Undergraduate Secretary. Without an admission of guilt it had to
go to the Dean. The Dean talked with the student and still no admission of
guilt. It went to a formal hearing. The student was found guilty and
kicked out of school. If he admitted guilt to the Undergraduate Secretary,
he would have received a zero for the assignment and lost 5%.

This case was different. He attempted to purchase the answer to the
assignment and had already been expelled from one program for a similar
offense. Still, things could be worse for you if you fight it and lose.

You have to see what are the consequence for you fighting this. If you are
going to lose nothing then fight it.

I snipped the code examples. The point the school is trying to make is not
how different the code you submitted was compared to the code you created.
It is the fact that you lied that is at issue. If you fight this you will
have to a) prove you did not lie or b) prove you did not realize what you
did was wrong.
 
R

Robocop

Just addition of few comments in the code would have avoided the
situation that I am in.
Unfortunately, I wasn't aware of it.

The purpose of the assign. was to understand the concepts which I
obviously & certainly DO.

I've got 2 class codes doing SAME thing. SAME OUTPUT.

I've also got a PROOF that making few CHANGES in MY CODE, it will work
PRECISELY as it SHOULD. (I've already posted MY code and the code from
the FORUM)

"few changes" were so mediocre that I didn't feel like doing them.


Had I known that this would result in such a big CHAOS, am I a moron
to send others code just to get 0.1% increase? LOL


I think the professor himself knows that its NOT A BIG DEAL even then
instead of giving a verbal warning (since its my FIRST TIME and the
assign. was only worth 2% & pretty SIMPLE; and the code which was
taken from the forum accounted for only 0.1%) he's opting for 5%
decrease and wants me to plead GUILTY.
 
J

John C. Bollinger

Robocop said:
I would extremely appreciate your advices, as it would help me make my
decisions. Please spare some time to read the following.
Here is what happened with me. We had to do an assignment worth only
2%. In it we had to make 7 classes one of them is below.
After spending hours I completed the entire assgn. and I had a little
bug in one of the class given below, so I decided to go to a forum.
There we discussed the problem and one person gave the code GIVEN
BELOW. So I ran it with my other classes and it worked, when I looked
at the code written by the person from the forum I quickly realized
what the _mistake_ in my code was and what changes it needed, as that
mistake was pretty much "trivial" and mediocre; I didn't bother to
correct that mistake in my code and I sent the code from the forum (1)
given below as according to me it was no big deal as no one was ever
going to SEE the code and mark it and also the implementation of the (2a)
method in the code given by the person in the forum was pretty good
and no. of lines were few compared to MINE so I favored that code and
NOT mine . (3)
Moreover, the code was ONLY going to be marked by a
"TESTDRIVER" AUTOMATICALLY based on the OUTPUTS of the methods. (2b)
If you look at the code below (from the forum) and the one after it
(MINE). BOTH the codes will give SAME OUTPUTS if tested by the
TESTDRIVER, so it doesn't matter which code I used.
I've ALSO POSTED THE "method" (at the bottom) in the class written by
me which compelled me to take OUTSIDE HELP.

Now I am charged with >>>"ACADEMIC DISHONESTY"<<< I don't know what to
do now. I thinks its just laughable to be charged for such simple
thing; also me being a first year student, I don't think its fair.

FOR 2% THIS MUCH? I have to lose 5% now because of this.
There were 7 classes and just due to ONE METHOD which accounts to
about 0.2% of the entire assignment.!!!

SO, for thing of 0.2% I've to LOSE 5%????

I could have avoided this whole thing had I known that "we have to add
the name and the address of the reference" from where the segment of
the class was taken from. But being a NOVICE I wasn't aware. (4)

I had with the people in the FORUM and the few things I said about the
INSTITUTION.



SHOULD I GO FOR A FORMAL HEARING IN FRONT OF LOT MORE PEOPLE TO PROVE
MYSELF INNOCENT OR SHOULD I ACCEPT THE CHARGES AND PLEAD *GUILTY* AND
ACCEPT 5% DECREASE IN MY OVERALL RESULT???

By submitting work that did not assign any credit to other authors [4]
you claimed that the work was all your own. It wasn't. [1] Your stated
reasons for that is that the code given to you was better than your own
[3] (which is all the more reason for you to give appropriate credit to
the author) and that you didn't want to "bother" to fix your own code
[1]. You thought you could get away with your actions because no one
would scrutinize the code you submitted [2a, 2b], but you were caught
anyway.

As a student at your institution you are responsible for knowing all the
relevant university, department, and class policies, including
especially those pertaining to academic conduct. Typically these are
included in student handbooks and/or class syllabi, which very likely
you received but did not read.I don't see where you have any viable
defense on this. The actions you have taken fall within the applicable
definition of academic dishonesty at your institution. You ARE guilty.

Whether or not the penalty is appropriate is a different question, but I
could see anything from receiving a zero on the assignment to expulsion
from the institution. If a 5% reduction in your overall course score is
the penalty dictated by published policy then you have no alternative
but to take it. If there is no specific penalty established by policy
then you have little alternative but to accept the instructor's choice
of penalty. It doesn't seem excessive to me.

You will improve the outlook of the remainder of your academic career at
that institution by claiming ignorance (as you have done), apologizing,
and accepting your lumps. You earned them. Taking a defiant stance,
especially when you have no ground to stand on, will only be detrimental
to you.

I will also note that contrary to some other respondents' comments, such
behavior is not necessarily acceptable in industry. The difference
there is that rights to source code are generally owned by companies
rather than by individuals. It may be perfectly acceptable to borrow
code from elsewhere in your company's code base or to get help from
another employee in writing code. It is rarely acceptable, however, to
use code in your company's products that is not owned by the company and
is not in the public domain, as that is a violation of the author's
rights, which, if discovered, could lead to legal action and a financial
judgment against the company. That's what the SCO vs. IBM case is all
about (the actual merits of SCO's claims notwithstanding).


John Bollinger
(e-mail address removed)
 
S

Sam

Dear Folks:

I would extremely appreciate your advices, as it would help me make my
decisions. Please spare some time to read the following.
Here is what happened with me. We had to do an assignment worth only
2%. In it we had to make 7 classes one of them is below.
After spending hours I completed the entire assgn. and I had a little
bug in one of the class given below, so I decided to go to a forum.
There we discussed the problem and one person gave the code GIVEN
BELOW. So I ran it with my other classes and it worked, when I looked
at the code written by the person from the forum I quickly realized
what the _mistake_ in my code was and what changes it needed, as that
mistake was pretty much "trivial" and mediocre; I didn't bother to
correct that mistake in my code and I sent the code from the forum
given below as according to me it was no big deal as no one was ever
going to SEE the code and mark it and also the implementation of the
method in the code given by the person in the forum was pretty good
and no. of lines were few compared to MINE so I favored that code and
NOT mine . Moreover, the code was ONLY going to be marked by a
"TESTDRIVER" AUTOMATICALLY based on the OUTPUTS of the methods.
If you look at the code below (from the forum) and the one after it
(MINE). BOTH the codes will give SAME OUTPUTS if tested by the
TESTDRIVER, so it doesn't matter which code I used.
I've ALSO POSTED THE "method" (at the bottom) in the class written by
me which compelled me to take OUTSIDE HELP.

Now I am charged with >>>"ACADEMIC DISHONESTY"<<< I don't know what to
do now. I thinks its just laughable to be charged for such simple
thing; also me being a first year student, I don't think its fair.

FOR 2% THIS MUCH? I have to lose 5% now because of this.
There were 7 classes and just due to ONE METHOD which accounts to
about 0.2% of the entire assignment.!!!

SO, for thing of 0.2% I've to LOSE 5%????

I could have avoided this whole thing had I known that "we have to add
the name and the address of the reference" from where the segment of
the class was taken from. But being a NOVICE I wasn't aware.

I had with the people in the FORUM and the few things I said about the
INSTITUTION.



SHOULD I GO FOR A FORMAL HEARING IN FRONT OF LOT MORE PEOPLE TO PROVE
MYSELF INNOCENT OR SHOULD I ACCEPT THE CHARGES AND PLEAD *GUILTY* AND
ACCEPT 5% DECREASE IN MY OVERALL RESULT???

PLEASE ADVICE.


You should definitely fight it. Your mark doesn't matter. It is your
integrity and reputation that are the concern. You are being harshly
dealt with for no good reason. To save time, you just plugged the
corrected class, believing it to be the better solution, otherwise you
would've just plugged your own, which you had already written and
developed and where you understood where the bug was.

People tend to be very judgemental. Practice you arguments in front of
a mirror. You did nothing wrong, except maybe not being overly
diligent in attributing a source. Fight it with everything you have.
If YOU don't think you did anything wrong, niether will anybody else.
Be defiant.

Regards,
Sam90

/* Folowing is the code that I got from the FORUM*/

import java.util.Collection;
import java.util.ArrayList;
import java.util.Iterator;

public class Train {
public static final String BERTH = "berth";
public static final String SEAT = "seat";

private Collection railCars = new ArrayList();

// yuck.
public Train(int numSaloonCars, int nSeats, int numSleepingCars,
int nBerths) {

if (numSaloonCars < 0 || nSeats < 0 || numSleepingCars < 0 ||
nBerths < 0)
throw new IllegalArgumentException("No values less than
zero allowed");
if (numSaloonCars + numSleepingCars == 0)
throw new IllegalArgumentException("Gotta have railCars,
baby");
if (nSeats > SaloonCar.MAX_SEATS)
throw new IllegalArgumentException("Too many seats");
if (nBerths > SleepingCar.MAX_BERTHS)
throw new IllegalArgumentException("Too many berths");

railCars = new ArrayList();

for (int i = 0; i < numSaloonCars; i++) {
SaloonCar car = new SaloonCar(nSeats);
railCars.add(car);
}

for (int i = 0; i < numSleepingCars; i++) {
SleepingCar car = new SleepingCar(nBerths);
railCars.add(car);
}
}
// double yuck.
/*RELEVANT PART <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public String reserveSpace(String spaceType, int numP) throws
TrainFullException {

if (!spaceType.equals(SEAT) && !spaceType.equals(BERTH))
throw new IllegalArgumentException("invalid spacetype");
if (numP < 1) throw new IllegalArgumentException("numP must be

Iterator cars = railCars.iterator();

while (cars.hasNext()) {
RailCar car = (RailCar) cars.next();
if ( (spaceType.equals(SEAT) && car instanceof SaloonCar)
||
(spaceType.equals(BERTH) && car instanceof
SleepingCar) ) {
if (car.getAvailableSpace() >= numP) {
try {
return car.addPassengers(numP);
} catch (CarFullException cfe ) { /* not gonna
happen */ }
}
}
}
// if we get here, nothing's been allocated, so...
throw new TrainFullException();
}
public String toString() {
StringBuffer buf = new StringBuffer("Train[");
Iterator cars = railCars.iterator();
int count = 0;
while (cars.hasNext()) {
if (count++ > 0) buf.append(",");
buf.append(cars.next());
}
return buf.append("]").toString();
}

}




****FOLLOWING IS CODE WRITTEN BY ME, AFTER REVIEWING THE ABOVE CODE, I
JUST NEED TO ADDED >TRY AND CATCH< BLOCKS.
public class Train {

public Train(int numSaloonCars, int nSeats, int numSleepingCars,
int nBerths) {

if((numSaloonCars + numSleepingCars) <= 0
|| (nSeats + nBerths) <= 0 || numSaloonCars < 0 ||
numSleepingCars < 0) {
throw new IllegalArgumentException("input valid data!");
} else {
for(int i = 0; i < numSaloonCars; i++) {
atotal.add(new SaloonCar(nSeats));
}

for(int m = 0; m < numSleepingCars; m++) {
btotal.add(new SleepingCar(nBerths));
}
}
}
/* RELEVANT PART<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public String reserveSpace(String spaceType, int numP) {

StringBuffer buf = new StringBuffer();

if(( !spaceType.equals(BERTH) && !spaceType.equals(SEAT))
|| (numP <= 0)) {
throw new IllegalArgumentException("enter proper data!");
} else if(spaceType.equals(SEAT)) {
List train = new LinkedList(atotal);
int found = 0;

for(int i = 0; i < train.size(); i++) {

if(((SaloonCar) train.get(i)).getAvailableSpace()>=
numP)
{
found = i;
}

}
try{
buf.append(((SaloonCar)
train.get(found)).addPassengers(numP));
} catch (CarFullException e) {throw new
TrainFullException();}

}
else if(spaceType.equals(BERTH)) {
List train2 = new LinkedList(btotal);
int found2 = 0;
for(int m = 0; m < train2.size(); m++) {
if( ((SleepingCar) train2.get(m)).getAvailableSpace()
{
found2 = m;
}
}
try{
buf.append(((SleepingCar)
train2.get(found2)).addPassengers(numP));
} catch (CarFullException e) {throw new TrainFullException();}

}


return buf.toString();
}
*/

public String toString() {

StringBuffer buf = new StringBuffer("Train [");
List list = new LinkedList(atotal);
List list2 = new LinkedList(btotal);

for(int i = 0; i < list.size(); i++) {
buf.append(" SaloonCar[ ");
buf.append(((SaloonCar) list.get(i)).toString() + " ]");
}

for(int m = 0; m < list2.size(); m++) {
buf.append(" SleepingCar[ ");
buf.append(((SleepingCar) list2.get(m)).toString() + "
]");
}

return buf.toString();
}

private List atotal = new LinkedList();
private List btotal = new LinkedList();
public static final String BERTH = "berth";
public static final String SEAT = "seat";
}
//////////////////////////////////////////////////////////////////////

/*BELOW IS THE CODE WRITTEN BY ME *BEFORE* GOING TO THE FORUM*/
YOU CAN NOTICE THE ONLY ADDITION IS THE "TRY AND CATCH" BLOCKS.

public String reserveSpace(String spaceType, int numP) {

StringBuffer buf = new StringBuffer();

if(( !spaceType.equals(BERTH) && !spaceType.equals(SEAT))
|| (numP <= 0)) {
throw new IllegalArgumentException("enter proper data!");
} else if(spaceType.equals(SEAT)) {
List train = new LinkedList(atotal);

for(int i = 0; i < train.size(); i++) {
if(numP == ((SaloonCar)
train.get(i)).getAvailableSpace()) {
buf.append(
((SaloonCar)
train.get(i)).addPassengers(numP));
} else if(numP
< ((SaloonCar)
train.get(i)).getAvailableSpace()) {
buf.append(((RailCar)
train.get(i)).addPassengers(numP));
} else {
throw new TrainFullException("Train's Full!");
}
}
} else if(spaceType.equals(BERTH)) {
List train2 = new LinkedList(btotal);

for(int m = 0; m < train2.size(); m++) {
if(numP == ((SleepingCar) train2.get(
m)).getAvailableSpace()) {
buf.append(
((SleepingCar)
train2.get(m)).addPassengers(numP));
} else if(numP
< ((SleepingCar) train2.get(
m)).getAvailableSpace()) {
buf.append(
((SleepingCar)
train2.get(m)).addPassengers(numP));
} else {
throw new TrainFullException("Train's Full!");
}
}
}

return buf.toString();
}
 
J

John

Robocop said:
Just addition of few comments in the code would have avoided the
situation that I am in.
Unfortunately, I wasn't aware of it.

The purpose of the assign. was to understand the concepts which I
obviously & certainly DO.

I've got 2 class codes doing SAME thing. SAME OUTPUT.

I've also got a PROOF that making few CHANGES in MY CODE, it will work
PRECISELY as it SHOULD. (I've already posted MY code and the code from
the FORUM)

"few changes" were so mediocre that I didn't feel like doing them.


Had I known that this would result in such a big CHAOS, am I a moron
to send others code just to get 0.1% increase? LOL


I think the professor himself knows that its NOT A BIG DEAL even then
instead of giving a verbal warning (since its my FIRST TIME and the
assign. was only worth 2% & pretty SIMPLE; and the code which was
taken from the forum accounted for only 0.1%) he's opting for 5%
decrease and wants me to plead GUILTY.

Plead GUILTY. Since you took someone else's code and copied it into
yours, you submitted work that was not your own. Did you sign or agree
to a declaration that the code was all your own? If you did, then you
have been dishonest and deserve an absolute minimum of a 5% decrease.

If I were your lecturer I would have hammered you with 25% and put you
in front of the head of department and personal tutor (it happened to me
as an undergraduate and I was cleared).

If you take this further or appeal, I would like to see your lecturer
fail you (the whole course) in order to disuade you in the long run.

You must be struggling in Logic as well as Java to think that the
difficulty of the assignment or a vague similarity of your code to the
plagiarised code has any bearing whatsoever on this.

John
 
R

Rene

Just addition of few comments in the code would have avoided the
situation that I am in.
Unfortunately, I wasn't aware of it.

Yes that's the main problem here. The question is, why were you not aware
of it and how were the others made aware of this fact?
The purpose of the assign. was to understand the concepts which I
obviously & certainly DO.

I've got 2 class codes doing SAME thing. SAME OUTPUT.

I've also got a PROOF that making few CHANGES in MY CODE, it will work
PRECISELY as it SHOULD. (I've already posted MY code and the code from
the FORUM)

"few changes" were so mediocre that I didn't feel like doing them.

There are a lot of things that become easy once you saw the solution but
are hard when you haven't and need to find it yourself. If your university
is worth something, they teach you how to get to solutions and not
solutions themselves.

You've basically violated that. No matter if it's a small thing or you
would have known it in advance, you copied some stuff without referencing
the origin and that is violating a rule (you were not aware of).
Had I known that this would result in such a big CHAOS, am I a moron
to send others code just to get 0.1% increase? LOL

Hopefully not. But such people do exist.
I think the professor himself knows that its NOT A BIG DEAL even then
instead of giving a verbal warning (since its my FIRST TIME and the
assign. was only worth 2% & pretty SIMPLE; and the code which was
taken from the forum accounted for only 0.1%) he's opting for 5%
decrease and wants me to plead GUILTY.

You *are* guilty. You violated the rule. What is or may be debateable is
the amount of punishment and who did not do his job to make you aware of
this. Problem is: Should you challenge it and but possess one single piece
of paper where it is described, then you'll probably lose a lot more than
just gnawing your teeth and accept it.

I wouldn't fight it unless everybody had to sign a paper saying that the
handed-in work was ones own and no undocumented outside help was used and
they would have all those signed papers but yours. Everything else depends
on what you guess your chances are and if you are able to live comfortably
if it doesn't turn out in your favor.

FWIW, at my university we had small papers that had to be signed were such
stuff was written on.

CU

René
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top