| Author |
Message |
|
|
What part are you stuck on? I can help with some but am not sure where you're having issues.
isFound(String title) which searches the array for a title and returns true if found, false otherwise.
I would guess that this would walk through the array of books, doing something like:
right?
putBook(String title, String author,int quantity, double price) which adds a new book to the stock.
If the book title exists a message is output to the user, and the book is not added to the stock list.
So there are two parts here. The first is that you need to call the isFound() method to first see if the book exists already. Then, you will need to add the book at the first unused slot in the array. That is a key point. You'll need to walk through the array and, using equalsTitle() look for a Book that is actually an empty book (as determined by your constructor to BookFile).
sellBook(String title) which decrements the quantity of the book, if book in stock, and indicates whether the sale took place or not.
Again, you'll want to use the isFound() method to see if the book exists. Then, if it does, you'll want to decrement the quantity field for that particular book which is the sell() method on Book. Your sell() method in Book needs to "empty" the Book if the quantity goes to zero. That way you can add another one back into that slot if needed later.
|
 |
|
|
Some useful links:
|
 |
|
|
Some useful Spring links:
|
 |
|
|
Some useful links:
|
 |
|
|
Some useful links:
Please add more that you think are useful.
|
 |
|
|
Some links related to Java socket programming that might be useful:
Please feel free to post others.
|
 |
|
|
A few links that might be useful in doing JDBC development:
|
 |
|
|
I'm sorry, I'm not sure I understand the question. Do you mean you have a JTabbedPane with a JProgressBar or do you want the focus to be in the JProgressBar?
I'm also going to move this to the Swing Forum.
|
 |
|
|
You've still got some syntax errors - it looks like you need to change to something like:
Also, check where you're returning from the notePosition() method.
|
 |
|
|
amzy28587 wrote:
Array myArray = new Array();
myArray[number] = number * 10;
The issue here is that you are trying to treat the Array class like, well, an array. It isn't one.
Are you required to have multiple classes? You're going overboard when it comes to the use of the main method - only one class really needs that. So maybe your Array class could look a little more like:
and then...
|
 |
|
|
With some changes I got it to compile but I'm not sure what you want to do next - it isn't drawing the notes. I changed the code a little because I don't have the Keyboard class (I'll assume that that is something provided to you to read input) - you'll have to run this with command line arguments like "java FrameSkeleton a b c d e". It should be easy to change the main method to use Keyboard and StringTokenizer.
The biggest issue I think you have is that you seem to be parsing the input in alot of places. Localize that to one place and I think you'll do better.
|
 |
|
|
Do you have a table structure laid out? That would be the first thing. Based on what you have so far I think it would look something like:
where:
site_name is simplye the name that gets displayed - i.e. "XYZ Limited"
telephone is just that. It is nullable which means that it is optional.
displayed_url would be something like "www.xyz.com".
actual_url may or may not be the same as displayed_url. For example, you may want the user to access a page within a site so actual_url might be www.xyz.com/some/page/some/where or something like that. Or you might want to be able to tell the destination site that you sent them there with a parameter like www.xyz.com/referred?daveyjones
Once you have the table in MySQL then it is time to write the JSP. Where are you at with all of this?
|
 |
|
|
Integer.parseInt() takes a single String. You passed it an array of strings. Try instead something like:
Because you checked that there was one and only one argument you can then get at the first element in the array, arguments[0].
|
 |
|
|
|
|
 |
|
|
amzy28587 wrote:i understood that to mean that the star has a value of 9, and when star is less than 0, do star minus 1. so i thought the answer was 0, but i am really confused can anyone help???
That is the answer - try to run this for example:
Exactly as you have said - the integer star is never less than zero therefore the loop never runs.
|
 |
|
|