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...
Type: Posts; User: mattig89ch
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...
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...
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...
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...
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.
...
I did acutally, but I'll post it again.
int firstInput = Integer.parseInt(JOptionPane.showInputDialog("Enter First number"));
int secInput =...
Ok, I still haven't been able to find where my problem is. Does anyone know where my logic is going bad?
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...
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...
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...
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,...
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...
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
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...
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....
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. ...
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...
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 =...
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...
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,...
Trouble is, I don't understand the math behind it. Those google searches haven't helped that.
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...
Wait, is that what I was doing already with my first for loop?
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 =...
Thanks, what is api?