Bookmark Topic Watch Topic
  • New Topic

hi ,please help me ,thanks~  RSS feed

zhou xuguang
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator
have a question:

First of all write the code for a Customer class.
It will need features for the name, title, etc.
These should all be declared as private.
you will need methods for returning there features and a constructor
which will take as an parameter list all the detaild read from the file.
You will also need methods to add and subtract from their account. Save this file as

Next consider the databse class. How you store the data is up to you,
consider an array or a list and look up on web site how to use these classes.
You will need features to construct the database(these will of course only be one),
how to add a customer to the database, how to search the database for a custoner's name,
balance and title and how to rewrite the database to file at the end of the day.
This file will be called

Again you must consider security and code hiding.

The next task is to write a Queue.class. You will need to consider storage, adding to the back,
getting info from the front person, removing the front person, etc.

Finally you should write the Store class which will contain the main method and run the program.
This will need to read the database, construct Customer objects and add them to the Database object.
It will then read the transaction file one piece at atime, reporting on the state of the queue or transaction.
It will update the queue for each action, and update customer's records where necessary.
When the file is finished and the queue is empty it will report "Closing time" and rewrite the database.

there is some difficult to solve this question for me . help me please!!!
thanks a lot!!!
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Report post to moderator
You posted this in the Java Beginner's forum too. Please don't post the same questions in multiple forums as doing so wastes our time possibly answering a question that's already been answer. Also, your question has nothing at all do to with the SCJD exam, so it doesn't even belong here.

As we said in the Java Beginners section, JavaRanchers are not here to do your homework for you. If you at least take a shot at building your classes and find that you have specific questions, then we'll be glad to help. Until then, your best bet is to break down the requirements, possibly in outline form, and start thinking about how you would build your classes. If you don't know what goes into a class, then you need to start reading your textbook.

Good luck.
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12152
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Report post to moderator

As noted in this post by Ernest Friedman-Hill and here by Jeff Bosch, we don't like to do people's homework for them here at the Ranch. What we like to do is help them figure out how to do it themselves.

This sort of question does not belong in the SCJD forum - this forum is specifically for those members who are working on their assignments for the Sun Certified Java Developer certification. So please post replies to this copy in the Java in General (Beginner) forum.

Thanks, Andrew
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!