Monday, November 8, 2010
One more minor change to Assignment 9
Be sure to initialize your energy to 0 when you create your CollegeStudent.
Change to Assignment 9
A very small change has been made to the cram method. It now has the student drink a mountain dew before studying, then repeat until out of energy. Finally the student will sleep. The API has been updated accordingly.
Friday, October 22, 2010
Modification to Assignment #8
We have made a couple of modifications to Assignment #8 in order to simplify it somewhat. The assignment webpage has been updated. In a nutshell, the changes are for you to create a second constructor that has 3 parameters to create a specified date. You are no longer required to write methods for setMonth(), setDay(), and setYear(). You also do not need to write methods for nextMonth() and nextYear(). Finally, we are permitting you to use precise English instead of formal Java boolean expressions for your complex preconditions and postconditions. We will clarify this further in class on Monday, but don't wait to start working on the assignment.
Thursday, October 21, 2010
Sample solution for last question of Exam #2
package iamhungry;
/**
* This class models a college student.
*/
public class CollegeStudent {
private String name;
private int favoritePizzaTopping;
private int pizzasBaked;
/**
* This constructor creates a college student with a given name
* and a favorite pizza topping. The student has not yet baked
* any pizzas.
*/
public CollegeStudent (String name, int favoritePizzaTopping) {
this.name = name;
this.favoritePizzaTopping = favoritePizzaTopping;
this.pizzasBaked = 0;
}
/**
* This method commands the student to bake the pizza being
* passed in.
*/
public void bakePizza (FrozenPizza fp) {
fp.bake(425, 10);
pizzasBaked = pizzasBaked + 1;
}
/**
* This method checks if the given pizza has the tuype of topping
* that is the student's favorite.
*/
public boolean checkForPreferredPizza (FrozenPizza fp) {
return fp.topping() == favoritePizzaTopping;
}
/**
* This method classifies the student according to the number of
* pizzas they have baked. Less than 10 is a "taster" 10 - 20 is
* an enthusiast. Over 20 is a "connoisseur".
*/
public String classification () {
if (pizzasBaked < 10) {
return "taster";
}
else if (pizzasBaked <= 20) {
return "enthusiast";
}
else {
return "connoisseur";
}
}
}
Test 2 - last question
I was just wondering if you guys were going to post a solution to the last question of Test 2.
Thanks,
Josh
Monday, October 18, 2010
Assignment #7 extended until October 19th at 11:59pm
Just a reminder that we are giving you until tomorrow night (Tuesday, October 19) at 11:59pm to redo Assignment #7 and turn it in again.
Friday, October 8, 2010
Constructor for ObjectiveC Card Class
-(id) initWithFrame:(CGRect) rect {
[super initWithFrame:rect];
self.backgroundColor = [UIColor whiteColor];
image= [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"blank.jpg"]] autorelease];
image.frame = CGRectMake(0, 0, 80, 110);
image.opaque = YES;
[self addSubview:image];
return self;
}
[super initWithFrame:rect];
self.backgroundColor = [UIColor whiteColor];
image= [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"blank.jpg"]] autorelease];
image.frame = CGRectMake(0, 0, 80, 110);
image.opaque = YES;
[self addSubview:image];
return self;
}
To Turn on Ensure and Require Tags in Dr Java
Go to Edit->Preferences. In custom Javadoc parameters, enter:
-author -version -tag require:cm:"Require:" -tag ensure:cm:"Ensure:"
-author -version -tag require:cm:"Require:" -tag ensure:cm:"Ensure:"
Tuesday, October 5, 2010
Assignment 6 Extension
There have been some questions on the requirements for assignment 6. We want to make sure all of the requirements are clear and take some time for questions tomorrow during class. Thus, we are extending the deadline for assignment 6 until Thursday (10/7) 11:59PM. Do note that assignment 7 is also posted and will be due next Tuesday (10/12).
Assignment 6 Additional Information
One additional note on the assignment due this evening. In the buyItem method in LittleTike, you should first check with Daddy to see if the LittleTike has enough money in their PiggyBank to buy an Item. If the LittleTike gets an affirmative response, you then should proceed to ask the Mommy to pleaseBuyItem. Do not ask Mommy to buy the item if Daddy indicates that there are insufficient funds in the PiggyBank.
Assignment 6: New File Available
A copy of the LittleTike.java which meets the requirements for assignment 5 is now available. If you did not successfully complete LittleTike for assignment 5, you can build off this version for assignment 6.
Tuesday, September 28, 2010
Homework 5: New Files Available
All of the class files are now available for homework 5. If you did not complete the previous assignments successfully, you may use the Item.class and PiggyBank.class as part of your solution for homework 5. The LittleTike.class file is also available if you want to use it for testing to verify that your solution works as expected. The LittleTike.class file may not be submitted as part of your solution. You must create a LittleTike.java file on your own and compile it to produce your own version of LittleTike.class for submission.
Thursday, September 16, 2010
Slight Correction for Assignment 4
We had a typo on Assignment 4 that is now corrected. The return type for getDescription() and getStore() should be String, and the return type for getCost() should be double.
Tuesday, September 7, 2010
Where to Find Your Grades
Just a note that homework 1 grades are posted on D2L. This is where you can view your grades throughout the semester.
Monday, August 30, 2010
Lab 1
Since we didn't get a chance to work with the lab assignment in class today, are we supposed to do anything with it before Wednesday?
Thanks.
Sunday, August 29, 2010
Reminder: D2L Survey
Don't forget to complete the survey in D2L before 9 AM tomorrow. It will take some time, so it is likely best to complete it this evening. The "Surveys" link is right under the course number (CS234) in D2L after you select our course. You should then see only one survey called "Assessment."
Wednesday, August 25, 2010
Enabling Java in Firefox
A few students today seemed to have correct HTML and Java code for their applet, but it still wasn't visible in the browser. This link provides some information on enabling Java in Firefox, with specific instructions for different versions of Firefox:
http://kb.mozillazine.org/Java
http://kb.mozillazine.org/Java
Tuesday, August 24, 2010
Website question
So I'm not sure if I'm posting this in the right place ... But how much information (length) should be in the webpage that we're creating?
Saving your HTML file
I received the following question:
"Hey, I'm having a bit of trouble with making my website for Friday. My problem is that after I save my codes and everything, I try to open it with Safari or Firefox, and it shows up with a bunch of weird symbols. I've tried simplifying the whole thing, so it's basic, but it still won't show up correctly. I just don't know what I'm doing wrong. Are we going to learn more about this on Wednesday?"
I imagine the problem may be one that is encountered when using notepad. When saving in notepad, make sure it has to save the file with a .html file extension and verify that it gets saved as plain text. And yes, we will be discussing this more on Wednesday.
Please don't hesitate to post additional questions here on the blog.
"Hey, I'm having a bit of trouble with making my website for Friday. My problem is that after I save my codes and everything, I try to open it with Safari or Firefox, and it shows up with a bunch of weird symbols. I've tried simplifying the whole thing, so it's basic, but it still won't show up correctly. I just don't know what I'm doing wrong. Are we going to learn more about this on Wednesday?"
I imagine the problem may be one that is encountered when using notepad. When saving in notepad, make sure it has to save the file with a .html file extension and verify that it gets saved as plain text. And yes, we will be discussing this more on Wednesday.
Please don't hesitate to post additional questions here on the blog.
Sunday, August 22, 2010
Welcome
Welcome to the course blog for CS234. This will be a space for us to communicate and discuss topics of interest to the class. Please use this as your first point of contact with the instructors and other classmates, and feel free to respond to questions and ideas others have posted.
Subscribe to:
Comments (Atom)