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

 

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

Write a method that returns how many times the value of 7 appears in an array of integers. For example, count7s({6, 77, 777, 3, 7, 5}) returns a 1 since the value 7 only appeared once in that array. Please note that you are NOT counting the number of times the DIGIT 7 appears in the array.


count7s([3, 5, 7, 7, 2, -7, 6, 12, 9, 7]) → 3
count7s([7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) → 14
count7s([6, -7, -7, 8, 154, 3, 0]) → 0

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

public int count7s(int[] nums) { }

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: 250

Copyright Nick Parlante 2017 - privacy