Ok I found issues with my previous code..I have resorted back to my while loops but have integrated the modulus, which solves the issue of $45 printing all $5...Im happy with my code, its does what...
Type: Posts; User: u-will-neva-no
Ok I found issues with my previous code..I have resorted back to my while loops but have integrated the modulus, which solves the issue of $45 printing all $5...Im happy with my code, its does what...
ok I solved all of my issues...any advice in improving it further?
public static int cash(int k)
{
//variables
int mod;
I found a temporary solution to splitting up the remainder of $15...just using an if else statement...
public static int cash(int k)
{
//variables
int mod;
int total;
oh I see... I have been able to simplify it alot more. However, I and using one for loop...my other issue is that when i enter a number such as $20, my output when compiled is $20, $0 because i am...
While I have still not found the solution, i would just like to thank you two for helping me!
Yes i see your point, for £45 you would rather have £20,£20,£5...So i only need division and modulus...not even a for loop or any loop for that matter?
how exactly would that help?
Hello everyone, I have made a program that is to act like a cash machine. While it is unrealistic, it works...I was wondering if anyone would like to comment on how to improve my method for printing...