tags:

views:

90

answers:

2

I am working on a project and have the following psuedocode:

// create a private method, getIntValDialog, that returns an integer value and accepts
// two string values as arguments
    // declare and initialize a string variable, sValue, to an empty string
    // Accept input to sValue from a Input Dialog using smessage, stitle, and a question icon as arguments
    // return the integer converted value of sValue
        // end getIntValDialog method

I have an idea, but I don't quite understand how to set this up properly. The psuedocode tells me what I have to do, but I just need some help understanding and visualizing how this works. Any help would be appreciated :)

A: 
// create a private method, getIntValDialog, that returns an integer value and accepts 
// two string values as arguments
// declare and initialize a string variable, sValue, to an empty string
// Accept input to sValue from a Input Dialog using smessage, stitle, and a question icon as arguments
// return the integer converted value of sValue
// end getIntValDialog method

Here's what I get out of your pseudo-code:

private int getIntValDialog(String smessage, String stitle)
{
     String sValue = "";

     // Something else is happening here.

     return Integer.valueOf(sValue);
}

You take it from here.

I have an idea, but I don't quite understand how to set this up properly.

Some advice for future questions: If you truly do have an idea, please post it as best you can and let people correct any errors. It'll show good faith effort that you're working.

duffymo
the access modifier should probably be `private`
akf
I understand... thank you though, that helped me understand it a lot better.
Holly
Yup, going too fast, and habits took over. I'll correct it.
duffymo
If you decompose each statement of the given task and really teach this stuff instead of just giving the codes, I'll upvote you.
Esko
It's hard to see how much more detailed I can get. It's probably not worth a vote to me.
duffymo
A: 

You might get started here.

fastcodejava