Wednesday June 18, 2008 | CSC 257 Online CSC 257 Class Discussion |
|
Exercise 11 Problem 1
For problem 1, I used:
sum += (Integer)i.next(); Instead of the statement given by the answer key: sum += ((Integer)i.next()).intValue(); The same goes for the removeSet() method, also. I got the same answer either way for both methods. Is there a reason to use intValue();? Or does it matter? I use Java 5.0 if that helps. Posted by elstuelk ( Jun 14 2008, 06:42:32 PM EDT ) Permalink Comments [1]
Project 2, more questions
Do we turn in all of the .java files, Queue.java, vehicleFactory.java, etc? Or just our new/updated .java files, Simulator.java, Vehicle.java, Car.java, Truck.java, log.java. If we turn them all in, do we just leave the documentation/author as Jo Perry. Thanks, Shawn Posted by sdmiller ( Jun 01 2008, 03:02:44 PM EDT ) Permalink Comments [1]
Project 2
The project says that if the code is correct we will obtain the following results
Thanks, Shawn Posted by sdmiller ( May 29 2008, 06:49:42 PM EDT ) Permalink Comments [5]
FlowLayout & Alignment
I'm having difficulty getting my GUI to layout exactly like the one in the project specs. I can get all of the data displayed, but can't seem to grasp how to make the text and values for the Score, Cumulative, and guess status to line up top to bottom. I'm able to add parameters to set things as left justified and such, but can't see how to make it go from top -> down. Am I going to completely wrong route here? Also, will the display matching that of the picture in the specs be part of the grading? thx Posted by ammcknig ( May 22 2008, 01:53:41 PM EDT ) Permalink Comments [3]
Few Questions
In Project 1, do we need to handle incorrect input into the text field, such as "abc". Right now my program just treats it as an incorrect guess with no real feedback of 'too high' or 'too low'. I am not sure at the moment how to deal with keeping the input as an int since I already have to parse the string to an int to begin with.
Also, I am thinking of using the bottom output field that normally displays "<number> is too high" to use as an information field for when the user tries to submit before pressing new game it will say "Please press new game to start". Also if a number falls outside of the 1-100 it will display "invalid entry". Would this be acceptable or should be display some sort of messagebox popup instead? Any Help is appreciated! Shawn Posted by sdmiller ( May 21 2008, 07:41:30 AM EDT ) Permalink Comments [1]
Problem compiling
When trying to compile HelloWorld.java, I get:
Error occurred during initialization of VM Could not reserve enough space for code cache I am logging into remote.eos.ncsu.edu, which is the FAQ solution to the problem. Posted by mhnash ( May 19 2008, 10:52:06 AM EDT ) Permalink Comments [3]
Welcome
Welcome to CSC 257, Introduction to Java (for C++ programmers). This course officially begins on Monday, May 19.
The purpose of this blog is to provide class discussion. In order to post a blog entry, you must:
We'll be sending out email during the first week of classes with more information. The course website is currently available to registered students: http://courses.ncsu.edu/csc257/lec/651/ Posted by jctetter ( May 18 2008, 03:37:13 PM EDT ) Permalink Comments [0] |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Your final exam is scheduled for Monday, June 23 from 6:00 - 9:00 pm in room 1010 in building EB1.
The final exam is open-book, open-notes. There are 12 multi-part questions. The total number of points on the exam is 110, so there are effectively 10 points for extra credit.
I have broken down the exam questions into very rough categories as follows.
A few of the questions are true/false.
Some of the questions are short answer. An example of such a question is:
Suppose A.java is Java source code with no syntax errors. What is the name of the class file generated when A.java is compiled?
You must write some code, make corrections in some code, and analyze much code. An example of a coding question is:
Define a class named C with two characteristics: 1) C is a child of a class named B (which has a single constructor with a String parameter); and 2) C has a constructor that calls B's constructor with the string "Hello".
An example of an analysis question is:
In the previous question, suppose the constructor for C had not called the constructor for B. What would have been the result and why?
Here are the ground rules:
- The exam lasts 3 hours.
- The exam is open books, open notes. You may bring any printed resource materials that you wish.
- Laptop computers are not allowed.
- You may bring calculators (not helpful but allowed), cell phones, ipods, PDAs, or similar devices.
- You will need your own paper to write on.
Posted by jctetter ( Jun 18 2008, 08:43:01 AM EDT ) Permalink Comments [0]