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

 

jebbert@volusia.k12.fl.us > nov3_2017_APSLHL_count10s
prev  |  next  |  chance

Write a method that returns the "sum" of the three input parameters, but ONLY counts the number 10. Also, if the last number is 100 subtract 1 from the "sum" of the first two numbers (still ONLY counting 10s). For example, for 7, 10, 3 the "sum" would be 10 since there is only one 10 and the non-tens do not count. But 10, 10, 100 would be 19 since there are two 10s adding up to 20, but since the last number is 100 you subtract 1 from this sum to get 19. Look at the test data for additional examples.


nov3_2017_APSLHL_count10s(10, 10, 10) → 30
nov3_2017_APSLHL_count10s(10, 70, 45) → 10
nov3_2017_APSLHL_count10s(18, 22, 50) → 0

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

public int nov3_2017_APSLHL_count10s(int a, int b, int c) { }

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

Difficulty: 290

Copyright Nick Parlante 2017 - privacy