Search:

Type: Posts; User: JAKATAK

Search: Search took 0.17 seconds.

  1. Replies
    3
    Views
    182

    logic error in for loops

    I'm trying to get a program that displays all the numbers from 10 to 800 , 10 per line, that's divisible by 5 and 6 and having the numbers seperated by one space.

    Can someone tell me exactly what...
  2. Re: Trying to get an "if" statement to work in a "for loop".

    I just assumed there needed to be an if statement because I couldn't get each row to increase by " " (2 spaces) each time. How would you increase it by 2 spaces each iteration then? normally this...
  3. Trying to get an "if" statement to work in a "for loop".

    This isn't homework, it's a question in a textbook practice example that I can't seem to get right.
    I got it to work with 3 for loops, but I don't know how to get it to work with 2 for loops and a...
  4. Thread: while loop

    by JAKATAK
    Replies
    1
    Views
    165

    while loop

    I'm trying to get my while loop to include negative numbers except -9999.
    I could get my code to read positive numbers like 5 having a sum of odd numbers of 9, but trying to get negative numbers...
  5. Replies
    0
    Views
    217

    [SOLVED] Confused on Prime numbers

    EDIT: I figured it out finally, I actually did need to use a for loop. Here's my solution to my own problem:


    System.out.println("Enter a positive integer: ");
    int num = input.nextInt();
    ...
  6. [SOLVED] Re: Logic error in Math.pow(a,b) using JOptionPane

    Thank you, Wow i feel like an idiot. My code was actually correct I just thought when I was typing in integer numbers into the program that for some reason the Area couldn't be a decimal number and...
  7. [SOLVED] Re: Logic error in Math.pow(a,b) using JOptionPane

    I tried doing what Norm said,
    I'm using:
    x1 = 2, x2 = 2
    y1 = 4, y2 = 4


    double side1 = Math.pow((x2-x1),2);//this equals 4.0


    then I added another Math.pow()
  8. [SOLVED] Re: Logic error in Math.pow(a,b) using JOptionPane

    It doesn't have any errors marked in the program when i have typed it all in, but when i compile and try to run it, it says:

    Errors in Workspace:
    Errors exist in required project(s):...
  9. [SOLVED] Logic error in Math.pow(a,b) using JOptionPane

    Hello,
    I've been trying to figure out one part of my code for around 3 hours.
    I've been rewriting it different ways, only running what the logic error is and not the other parts and I still can't...
Results 1 to 9 of 9