Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

A little help java

  • 21-01-2002 10:34am
    #1
    Registered Users, Registered Users 2 Posts: 1,684 ✭✭✭


    yeah seamus tis grand now figured it out eventually. cheers mate..


Comments

  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    I'm not entirely sure what you mean, but to make it user-interfaceable(:confused: ) take out the main method, and just have a class MaxHeap, with all those other methods in it, then create a class TestHeap or sumfink, and write a main method with prompts etc in it, that invokes the methods in MaxHeap. (that is what you meant by kbd isn't it?). OK, that's not necessary, but it's good practice, afaik. Umm if you want to be able to define the values in the array heap, just put some sort of prompt like:

    Enter the values you want for an array. '.' to finish:

    And then make a while loop that adds each value into the array (testing it first of course! :)), and checks to see if a '.' was entered to signify end of input. This is what I'm assuming you meant btw. :)


Advertisement