Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 1st, 2013, 10:09 PM
Meli2 Meli2 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 1 Meli2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 12 sec
Reputation Power: 0
Homework - Java array method to find number repeated

Hi, what is the syntax and method to use when trying to find the most repeated number and count the number of times is repeated in an array?

int array[] = {2,3,3,4,4,4,4,6};

//Method to find the most repeated #

I can printed by using:

system.out.println("4, is repeated 4 times");

I would like to know the method to find the number 4.

Thanks in advance!

Reply With Quote
  #2  
Old February 2nd, 2013, 04:25 AM
Aurum84 Aurum84 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 74 Aurum84 User rank is Sergeant (500 - 2000 Reputation Level)Aurum84 User rank is Sergeant (500 - 2000 Reputation Level)Aurum84 User rank is Sergeant (500 - 2000 Reputation Level)Aurum84 User rank is Sergeant (500 - 2000 Reputation Level)Aurum84 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 23 h 5 m 49 sec
Reputation Power: 17
Hi,

there is no such method to calculate the mode of a list , and since this is classified as an homework assignment I assume that your teacher wants you to implement that yourself.
If you have troubles with your implementation, we would be happy to help. We won't however provide a solution.
In case that you have limited experience with programming, my advice to you would be to first create some pseudocode or simulate this problem with pen and paper. Then, you can translate that to a java solution
Comments on this post
NormR agrees!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Homework - Java array method to find number repeated

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap