id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

findAvgOfPos


Create a method findAvgOfPos that will take in three integers. Find the average of only the positive numbers. Return that average as a double. If there are no positive numbers, return 0.


findAvgOfPos(4, 8, -3) → 6.0
findAvgOfPos(-5, 10, 15) → 12.5
findAvgOfPos(7, -2, -9) → 7.0

...Save, Compile, Run (ctrl-enter)

public double findAvgOfPos(int x, int y, int z) }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy