Explore BrainMass

Explore BrainMass

    Do not understand concepts of variables, classes, strings, and especially how to save data for later use when creating a program in java.

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    The attached file is the assignment I have been given to do. I can understand certain things, which I have attached in another file. But I don't understand some things and think i'm leaving something out, mybe some variables? somehow. As much help as you can give me with how to make the program work, especially the admit button, and hints for using java would be great.
    Basically, what do I need to do to make it work?

    © BrainMass Inc. brainmass.com November 24, 2022, 11:31 am ad1c9bdddf


    Solution Preview

    First, life will be much easier if you can give some specific questions, i.e., which parts you do not understand? But, anyhow, I will try to guess your true needs and deliver what i can.
    <br>In the driver class, say ProgAsgn2 class, you need to have a circular array or a linked list to keep the occupied bed for convenience of implementing NextPatient and PreviousPatient. Implementing a circular array may involve some tricky things, but can make NextPatient and PreviousPatient much easier. If you use linked list, then you have to do some extra work in tracing previous and next patient. Both way will work. You also need to maitain a "current" patient pointer in the patient data structure.
    <br>You also need another array or linked list to keep track of the available beds with their id numbers. For each new patient created, you need to check if there are available beds. If so, then you can admit the patient and take the bed from the list or array and put the patient with the bed number to the patient list or ...