Search:

Type: Posts; User: mattig89ch

Page 1 of 2 1 2

Search: Search took 0.08 seconds.

  1. Replies
    4
    Views
    1,283

    Re: Trying to calculate hours by the hour

    ok, so I have to take the amount of hours. And if they parked more then 3 hours, then add 50 cents on top of the flat rate to begin with. so if they parked 3.1 hours I need charge then 3.50.

    My...
  2. Replies
    4
    Views
    1,283

    Trying to calculate hours by the hour

    Hidy ho all, I have a homework assignment where I have to calculate the amount of hours someone parked in a parking lot.

    For every hour (or part of an hour) parked greater then 2 I need to charge...
  3. Replies
    14
    Views
    1,450

    Re: Finding the Greatest Common Denomenator

    oooooohhhhhhh, thats where the problem is then. I thought that || meant and. um....what does it mean?

    Edit: just updated the code, 25 and 30 now produce a result of 5! Woo! Thanks for your...
  4. Replies
    14
    Views
    1,450

    Re: Finding the Greatest Common Denomenator

    At this point, I'm getting decimals in my returns. no idea why. For example, if you divide 25 by 10 the result is 2.5. But when its saying that 25 % 10 = 0, so its storing 10 in GCD.



    At the...
  5. Replies
    14
    Views
    1,450

    Re: Finding the Greatest Common Denomenator

    ok, I'm with you so far. I think.

    its supposed to stop when the counter reaches the smallest number. And only assign anything to the GDC variable if the firstResult and secResult are both 0.
    ...
  6. Replies
    14
    Views
    1,450

    Re: Finding the Greatest Common Denomenator

    I did acutally, but I'll post it again.



    int firstInput = Integer.parseInt(JOptionPane.showInputDialog("Enter First number"));
    int secInput =...
  7. Replies
    14
    Views
    1,450

    Re: Finding the Greatest Common Denomenator

    Ok, I still haven't been able to find where my problem is. Does anyone know where my logic is going bad?
  8. Replies
    14
    Views
    1,450

    Re: Finding the Greatest Common Denomenator

    Right-o. I'm running the math through a do-while loop that terminates when the counter reaches the size of the smallest variable.

    The counter both controls the loop and provides something to get...
  9. Replies
    14
    Views
    1,450

    Re: Finding the Greatest Common Denomenator

    Thanks for that link. I think I may have a way to do it w/out using arrays. Would someone mind checking my logic to see how right or wrong I am?

    First the user inputs 2 numbers.

    Next I check...
  10. Replies
    14
    Views
    1,450

    Finding the Greatest Common Denomenator

    Hidy ho all,

    I just got an assignment where I have to find the Greatest Common denominator of 2 numbers that a user inputs.

    My first idea on how to do this is to loop through both numbers to...
  11. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    wew! Thanks for the help again all. Grade 100! Thanks to your help.

    Forum Question now, I have another math question(s) for my next hw assignment. Would it be better to just start a new topic,...
  12. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    wooo! it works! Thanks for the help all!

    Two last questions.

    First, is it possible to combine the 4 elements in the array into a single int?

    Second, is it possible to have java read the...
  13. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    X=1234

    Y[4] (creates an array of way with 4 shelves/things to store numbers in)

    Y[0] = 1
    Y[1] = 2
    Y[2] = 3
    Y[3] = 4

    Next I add 7 to the numbers
  14. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    not sure where your getting the 4 from. And what does >> mean? Is it like the % sign?

    But I can try to make an example of my steps up to this point.

    It may very well be that we simply can't...
  15. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    Thats actually the entire thing loop right there.

    And I did the remainder after dividing by 10 thing because that's what the instructions said to do. Now I have to figure out how to reverse that....
  16. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    fair enough

    that last part in slightly more detail.

    it enters the final for loop. I declare a local integer to temporarily hold a value, and initialize it to the iteration of the loop plus 7. ...
  17. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    sure

    First a little message box pops up asking the user for a 4 digit number.

    next I create a 4 member array.

    After that I run that 4 digit number through a for loop, breaking off the...
  18. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    You guys have been a big help so far. Math has never been a friend to me.

    Now two last questions I have.

    Heres the code I have so far thanks to your help:


    int input =...
  19. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    I could change the above program to have an int. A basic question for you all, is there a way to have output and input appear on the same line in the command prompt?

    For example, I'd like to say...
  20. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    oh, so its just a way of separating the right most number from the left most?

    edit: also, i'm not quite sure what to write for that test program.

    Would it be something like:

    int input,...
  21. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    Trouble is, I don't understand the math behind it. Those google searches haven't helped that.
  22. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    i'm not sure. up in my first post I have a for loop with a % sign as the arathmetic operator. And a cursory google search shows that as the way to finding the remainder by dividing by 10.

    Is...
  23. Replies
    30
    Views
    2,535

    [SOLVED] Re: Need some math help

    Wait, is that what I was doing already with my first for loop?
  24. Replies
    30
    Views
    2,535

    [SOLVED] Need some math help

    Hidy ho everyone,

    I found this code on how to break apart a number and store it in an array online. Quite frankly, I still don't understand how it works.



    int input =...
  25. Replies
    5
    Views
    1,204

    [SOLVED] Re: Help with calculating age

    Thanks, what is api?
Results 1 to 25 of 38
Page 1 of 2 1 2