Search:

Type: Posts; User: TheoMuffin

Search: Search took 0.09 seconds.

  1. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    You repeatedly tell me to look at the conditions, hence I am blind to my mistake and it is something incredibly silly and obvious.
    I realized that my human logic did not work here.

    I want the...
  2. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    I want the do {} while to loop until I get the input I desire. In this case, a symbol '*' which is of length 1.

    I want it to exit the loop when I receive the above-mentioned symbol.
  3. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    I updated the code above. I made a mistake, however it still doesn't do what I wanted.

    The program printed out this:

    Please indicate the operation:
    *****
    Symbol is: *****
    Operation symbol...
  4. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    So it's alright to dismiss the System.in method as unneeded or unreliable?

    Aside from that.. The renewed version still does funky stuff.


    package simpleProgram;

    import java.io.IOException;...
  5. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    I added a println just under the
    symbol = (char)System.in.read();


    Please indicate the operation:
    /
    Symbol is: /
    Please indicate the operation:
    Symbol is:
  6. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    package simpleProgram;

    import java.io.IOException;

    public class Calculator
    {

    public static void main(String[] args)
    {
  7. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    Bump. I will post the full program if that is what it takes to find a solution.
  8. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    That was my plan, however the Scanner has no sc.readChar();
  9. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    package calcPackage;

    import java.io.IOException;

    public class TypeCheck2 extends TypeCheck
    {
    @SuppressWarnings("static-access")
    public boolean CheckInputType(char character)
    {
    try
  10. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    I believe I have already supplied the necessary information, but.. this may help clarify:



    public static void insertSymbol()
    {
    TypeCheck2 input = new TypeCheck2();

    do
    {
  11. Replies
    23
    Views
    1,287

    Re: Do while loop skipping method 3 times

    Indicate the operation:
    -
    45
    Indicate the operation:
    13
    Indicate the operation:
    10
    Indicate the operation:
  12. Replies
    23
    Views
    1,287

    Do while loop skipping method 3 times

    Hello, I started learning java two days ago and I am well on my way on completing my first calculator.



    do
    {
    System.out.println("Indicate the operation: ");...
Results 1 to 12 of 12