Search:

Type: Posts; User: Norm

Page 1 of 2 1 2

Search: Search took 0.12 seconds.

  1. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    I've made several suggestions for solving the last problem you posted. What have you tried? You have to make an effort to solve the problem.
    Please post the code you are having problems with and...
  2. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Did you try to write the small testing program with a loop to scan a String and test its characters?
    Post it with your questions is you need help getting it to work.
  3. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    I suggest that you write a small test program so you don't hurt the main program.
    Work on the technique for scanning and testing the characters in the String.
    When you get the small test program to...
  4. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Write a small program for testing.
    Define a String with several characters that will be scanned in the loop.

    Define a loop that gets the characters one at a time from the String.
    The loop needs...
  5. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    If you don't understand how to use the try{} catch block use the second way.


    I don't understand what that is about.
  6. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Would 1234 be a valid input?

    One way to check if a String contains only numeric digits would be to use the Integer class's parseInt() method inside of a try{}catch block. The parseInt() method...
  7. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    I thought I did. If what I said in post #36 is not the problem, can you please explain what the problem is? Make a list the the steps you do and the steps the computer does and then explain what is...
  8. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Do you understand what I said in post #36?


    Your formatting is still wrong. It should look like this:

    }

    loop = JOptionPane.showConfirmDialog(null,"Try...
  9. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Why won't you fix the posted code to make it easier to read and understand?
    The statements should NOT all start in the first column. Add spaces to indent as per the link that has been posted...
  10. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Your code is hard to read and understand.
    Please edit your code and format it. All statements should not start in the first column.
    See: Code Conventions for the Java Programming Language: 4....
  11. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    There are more than one if statement. Which one do you want done first?
    With if/else if statements, the first one that is true is the only one that will be executed. The following ones will be...
  12. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    If you want the program to give an error message for input of more than one character, have it test the length of the String it reads in from the user.


    Please edit your code and format it. All...
  13. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    The code reads the full input from the user into a variable and then takes the first character.
    If you want all of the input, use it instead of just using the first character.


    Please edit your...
  14. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Please edit you post and change the quote tags to code tags.
    Also please format the code. All statements should NOT start in the first column.

    What is the square root of 8?

    Your code only...
  15. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    It's at this link:
    The API doc: Java Platform SE 7
  16. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Look at the API doc for the String class. It has a method that will give you the length.


    Define what you mean by a character? The only data that can be entered easily via the keyboard is a...
  17. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    You can test if the user input a single letter by testing the length of the String.


    I'm not sure what you are asking here. Do you want to replace the tests for case with a test for letter?
  18. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Please explain what it is that you want to do.

    Please edit your code and format it so it is easier to read. Code within {}s should be indented at least 3 spaces to show logic levels.
  19. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Read the API doc for the Character class.
    If you have questions about one symbol's type, print out the value returned by the getType() methd and look it up in the table of definitions referred to by...
  20. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    If you want the "character is a symbol" message to print for an "*" you need to add a test to the if statement that controls the printing of that message.


    else if(Character.getType(inputs) ==...
  21. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    What is printed out in the else statement you added to the end of the if/else if chain?

    What is the value of the '*'? Does your code test for it?
  22. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    For a test, change this line and execute the program and see what happens:

    input= "*"; // JOptionPane.showInputDialog(null,"Enter a character :");


    At the end of the chain of if/else if you...
  23. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Can you copy and post here the content of the console that shows your input and the programs output?

    Also Look at the API doc for the Character class. Is '*' defined as a symbol?
  24. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Your code uses a char like '9' as if it were an int 9. You need to convert the char digit to an int value.
    One way to do that is to subtract '0' from the char: '9' - '0' = 9

    Did you try this:...
  25. Replies
    56
    Views
    5,218

    Re: java programming assignment help

    Include what? Please be more specific.

    Please edit your post and change quote to code tags.
Results 1 to 25 of 28
Page 1 of 2 1 2