#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    1
    Rep 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
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,711
    Rep Power
    348
    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?

IMN logo majestic logo threadwatch logo seochat tools logo