Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   Average returned as 0.0? (https://www.askmehelpdesk.com/showthread.php?t=767833)

  • Sep 19, 2013, 08:57 AM
    Zenboraku
    Average returned as 0.0?
    Hi, I'm currently trying to make a program that throws a dice 30 times and then returns the average throw.

    It looks like this; Image #238502 - CtrlV.in Image Hosting
    I don't know why my average is returned as 0.0.
    Anyone know why?
    Thank you for your time.
  • Sep 20, 2013, 01:37 PM
    Pelusawoman
    What are you doing with total?

    double average;
    double total; (What is the value? Zero?)
    ...
    average = total/30;

  • All times are GMT -7. The time now is 10:09 PM.