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 November 4th, 2012, 10:52 AM
darkangel_13 darkangel_13 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 darkangel_13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 29 sec
Reputation Power: 0
Hi please i need some help

Hi I i'd like to make a code in java without arrays with the next purposes:
->read some caracteres separates by (,) like this #,$,%,&,@,_,
->next replace the caracteres who are repeated more than 3 times;
-> next show to user;

i have a code but its not right

Code:
public static String IntroduzirLinha(){
			Scanner leitor = new Scanner(System.in);
		System.out.println("De uma frase terminada com  ");
		
		String token = leitor.next();
		String result = "blablablabla";
		int aCount = 0;
		for (int i=0; i<result.length(); i++) {  
		char c = result.charAt(i);  
		

		
		switch(result)
		{
			case 'a':
				aCount = aCount +1;
				break;
			case 'b':
				aCount = aCount+1;
				break;
			case 'l':
				aCount = aCount +1;
			default:
				System.out.println("Erros in id char");
			}
		}
		String newString = result.replace('e', 't');
				token=leitor.next();
				System.out.println(newString);	
				return result;
	}


I'd like some help please , ty in advance

Reply With Quote
  #2  
Old November 5th, 2012, 08:31 AM
NormR's Avatar
NormR NormR is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2010
Location: SW Missouri
Posts: 3,045 NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level)NormR User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 16 h 44 m 17 sec
Reputation Power: 346
Not using arrays will make it harder.
First you need to work out the logic to do the job. When that looks good, then move on to writing the code.
What ideas do you have for the logic?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Hi please i need some help

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