The following are in reverse chronological order.
Plagiarism and academic honesty guidelines: Each student does his/her own project although you may ask other students and/or me about clarifying the project or for ideas about how to approach doing something in the project. You will do all the computer work yourself (including typing and mousing) and not allow another student to copy your work and not yourself turn in work copied from someone else. You will not ``dictate'' mousing and typing to another student nor be ``dictated'' to yourself.
Corotan 8 no answers provided for the submitted final exam questions xyz2 6 no final exam questions with answers submitted
public void printProductDetails() {
for (Product product : stock) {
System.out.println(product);
}
}
public Product findProduct(int id) {
for (Product product : stock) {
if (product.getID() == id) {
return product;
}
}
return null;
}
012988 50 30+5+5+5+5 compile errors partial credit
102787 25 5+5+5+5+5 compile errors partial credit
1582 60 30+15+5+10+0 error in findproduct
2295 115 numberInStock incorrect
31588 50 30+5+5+5+5 compile errors partial credit
3181 75 30+30+15+0+0 no delivery, addProduct fix
C7819 50 30+5+5+5+5 compile errors partial credit
ChessDork 130 all okay
Corotan 130 all okay
KnightWind 120 30+30+5+15+10+10+20 error in numberInStock
MX5 50 30+5+5+5+5 compile errors partial credit
S66 50 30+5+5+5+5 compile errors partial credit
WayneBrody 110 did all but stock levels below
rufus 25 5+5+5+5+5 compile errors partial credit
slkjdgf 130 all okay
xyz2 0 no files
xyz3 0 no files
xyz4 130 all okay
boot: knoppix bootfrom=/dev/sda1/knoppix.iso type ENTER key
and remove the CD when booting is complete.
Knoppix will run much faster this way.
public class Auction {
// Unaltered code not shown.
// New version of getLot below replaces original version
// in order to remove the relationship (dependency) that
// nextLotNumber -1 always == positionNum.
/**
* Return the lot with the given number. Return null
* if a lot with this number does not exist.
* @param lotNumber The number of the lot to return.
*/
public Lot getLot(int lotNumber) {
if ((lotNumber >= 1) && (lotNumber < nextLotNumber)) {
Iterator<Lot> it = lots.iterator();
while (it.hasNext()) {
Lot lot = it.next();
if (lot.getNumber() == lotNumber) {
return lot;
}
}
return null;
}
else {
System.out.println("Lot number: " + lotNumber + " does not exist.");
return null;
}
}
// New methods follow.
/**
* Close the auction and print the results.
*/
public void close() {
Iterator<Lot> it = lots.iterator();
while (it.hasNext()) {
Lot lot = it.next();
System.out.println(lot);
// println(lot.getDescription() + lot.getNumber())
Bid highestBid = lot.getHighestBid();
if (highestBid == null) {
System.out.println("The lot has no bid.");
} else {
Person p = highestBid.getBidder();
System.out.println("Highest bidder has name " + p.getName());
System.out.println("The highest bid is " + highestBid.getValue());
}
}
}
/**
* Return an ArrayList, perhaps empty, of unsold lots.
*/
public ArrayList<Lot> getUnsold() {
Iterator<Lot> it = lots.iterator();
ArrayList<Lot> unsold = new ArrayList<Lot>();
while (it.hasNext()) {
Lot lot = it.next();
Bid highestBid = lot.getHighestBid();
if (highestBid == null) {
unsold.add(lot);
}
}
return unsold;
}
/**
* Return an ArrayList, perhaps empty, of unsold lots.
* Remove unsold lots from the original ArrayList of lots.
*/
public ArrayList<Lot> removeUnsold() {
ArrayList<Lot> unsold = new ArrayList<Lot>();
int positionNum = 0;
while (positionNum < lots.size()) {
Lot lot = lots.get(positionNum);
Bid highestBid = lot.getHighestBid();
if (highestBid == null) {
unsold.add(lot);
lots.remove(positionNum);
} else {
positionNum++;
}
}
return unsold;
}
/**
* Remove the lot with the given number and return it.
* Return null if a lot with this number does not exist.
* @param lotNumber The number of the lot to return.
*/
public Lot removeLot(int lotNumber) {
if ((lotNumber >= 1) && (lotNumber < nextLotNumber)) {
int positionNum = 0;
while (positionNum < lots.size()) {
Lot lot = lots.get(positionNum);
if (lot.getNumber() == lotNumber) {
System.out.println("removing position " + positionNum);
lots.remove(positionNum);
return lot;
}
positionNum++;
}
return null;
}
else {
System.out.println("Lot number: " + lotNumber + " does not exist.");
return null;
}
}
}
Card[] cards = new Card[5];
cards[0] = card1; cards[1] = card2; cards[2] = card3; cards[3] = card4; cards[4] = card5;
for (i = 0; i < cards.length-1; i++) {
for (j = i + 1; j < cards.length; j++) {
if (cards[i].getValue() < cards[j].getValue()) {
Card temp = cards[i]; cards[i] = cards[j]; cards[j] = temp;
}
}
}
card1 = cards[0]; card2 = cards[1]; card3 = cards[2]; card4 = cards[3]; card5 = cards[4];
/**
* Twelve-hour clock display. Internal time is a 24 hour clock.
*/
class ClockDisplay {
private NumberDisplay hours = new NumberDisplay(24);
private NumberDisplay hours12 = new NumberDisplay(9876); // limit unused
private NumberDisplay minutes = new NumberDisplay(60);
private String display12String; // simulates the actual 12 hour display
private String displayString; // simulates the actual 24 hour display
...
private void updateDisplay() {
String ampm;
displayString = hours.getDisplayValue() + ":" + minutes.getDisplayValue();
if (hours.getValue() == 0) hours12.setValue(12);
else if (hours.getValue() > 12) hours12.setValue(hours.getValue() - 12);
else hours12.setValue(hours.getValue());
if (hours.getValue() < 12) ampm = " am";
else ampm = " pm";
display12String = hours12.getDisplayValue() + ":" + minutes.getDisplayValue() + ampm;
}
}
Sun Releases NetBeans Version for BeginnersScott Ferguson - eWEEK
Wed Sep 20, 2:22 PM ET
Sun Microsystems, along with the NetBeans community and the University of Kent, has announced the general availability of a new version of the NetBeans integrated development environment, the NetBeans IDE/BlueJ Edition.
The NetBeans IDE/BlueJ Edition, like the original NetBeans IDE, is a free, open-source IDE.
However, the BlueJ Edition is an educational tool that provides a migration path for students transitioning from educational tools to a full-featured, professional IDE, officials at Santa Clara, Calif.-based Sun said.
BlueJ is a programming environment developed at the University of Kent, United Kingdom, and Deakin University in Melbourne, Australia, aimed at helping to train beginning programmers in Java.
The platform provides educational tools, such as visualization and interaction facilities that help developers learn object-oriented programming concepts.
The academics initially released BlueJ in 1999, and it is now used in more than 600 colleges and universities around the world, Sun said.
In an interview with eWEEK in March 2006, James Gosling, a Sun vice president and the creator of the Java language, said: "The hottest thing in tools right now that I can think of is around the folks from BlueJ and the folks from NetBeans getting together, to not only get people started with development, but to then take them from novice stages to serious development."
Gosling spoke with eWEEK at the Sun Worldwide Education and Research Conference in New York.
Sun officials said there have been more than 10 million downloads of NetBeans.
"I have been waiting for the NetBeans/BlueJ edition to come out since I saw how fantastic the Beta was to use," said Jason Morin, Math and Computer Science Instructor, Overland High School, Cherry Creek School District, Aurora, Colo., in a statement.
"NetBeans/BlueJ is now used in my Advanced Placement Computer Science class. I tried Eclipse, but it is a nightmare for teachers to manage, and Eclipse is difficult to grasp for students who are new to programming.
"I wanted and needed a 'transition' to a professional IDE tool, and that is exactly what the NetBeans/BlueJ edition provides."
Meanwhile, also in a statement, Laurie Tolson, vice president of Java Development and Platform Engineering at Sun, said: "While BlueJ allows teachers to instruct students on object oriented development?now the standard introductory phase of learning to program?the NetBeans/BlueJ edition provides a logical next step enabling students to extend their applications beyond simple models while learning to use a professional development environment."
Check out eWEEK.com's Application Development Center for the latest news, reviews and analysis in programming environments and developer tools.
TO: Computer Science Freshmen and Transfer Students FROM: Jennifer Kay, Chair, Computer Science Department SUBJECT: Mandatory Freshmen and Transfer Orientation Meeting Welcome to the CS department! The Computer Science department will be holding an orientation meeting for all new CS majors. This meeting is MANDATORY for all students who have entered the major any time after September of 2005, and attendance will be taken. Students who are not new are encouraged to attend. DATE: Wednesday September 13th TIME: 10:50 am - 12:05 pm LOCATION: Robinson 201 A/B If you are a new CS student and have a conflict with this meeting, please reply to this message explaining why you will not be able to be there and we will make alternate arrangements for you. See you there, Dr. Kay
home page:
http://elvis.rowan.edu/~hartley/index.html
e-mail:
hartley@elvis.rowan.edu