Search:

Type: Posts; User: u-will-neva-no

Search: Search took 0.10 seconds.

  1. Re: Improving the code to produce the same program

    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...
  2. Re: Improving the code to produce the same program

    ok I solved all of my issues...any advice in improving it further?



    public static int cash(int k)
    {


    //variables
    int mod;
  3. Re: Improving the code to produce the same program

    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;
  4. Re: Improving the code to produce the same program

    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...
  5. Re: Improving the code to produce the same program

    While I have still not found the solution, i would just like to thank you two for helping me!
  6. Re: Improving the code to produce the same program

    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?
  7. Re: Improving the code to produce the same program

    how exactly would that help?
  8. Improving the code to produce the same program

    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...
Results 1 to 8 of 8