Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7662631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:50:58+00:00 2026-05-31T13:50:58+00:00

I have to solve a small problem: for a given array of chars, char[]

  • 0

I have to solve a small problem:
for a given array of chars,

char[] lista = {'a', '2', '?', 'd', '!', 'S', '3', 'D', 'k'}; 

I must:

  1. Print only the vowels;
  2. Print only the consonants;
  3. Print the numbers and;
  4. Print the others symbols.

I’m having problems in 4.

My code so far:

public class Teste {

    public static void main(String[] args) {
    char [] lista = {'a', '2', '?', 'd', '!', 'S', '3', 'D', 'k'};
    char [] vogal = {'a', 'e', 'i', 'o','u','A','E','I','O','U'};
    char [] numbers = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'};
    char [] leters = {'b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z','B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z'};
    char [] symbols = {'a', 'e', 'i', 'o','u','A','E','I','O','U','1', '2', '3', '4', '5', '6', '7', '8', '9', '0','b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z','B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z'};

    for (char j=0; j<lista.length ; j++)
    for (char i=0; i<vogal.length ; i++ ){
    if ( vogal [i] == lista [j] )
    System.out.println( "the vowels are: " + vogal [i] );
    }

    for (char j=0; j<lista.length ; j++)
    for (char x=0; x<numbers.length ; x++ ) {    
    if ( numbers [x] == lista [j] )
        System.out.println( "the numbers are: " + numbers [x] );       
    }

    for (char j=0; j<lista.length ; j++)
    for (char y=0; y<leters.length ; y++ ) {    
    if ( leters [y] == lista [j] )
        System.out.println( "the leters are: " + leters [y] );       
    }
        //my main problem is here 
    for (char j=0; j<lista.length ; j++)
    for (char z=0; z<symbols.length ; z++ ){    
    if (symbols [z] != lista [j])
         System.out.println( "the symbols are: " + lista [j]); 
}
 }
    }

Any suggestion about how to print the symbols?
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:51:00+00:00Added an answer on May 31, 2026 at 1:51 pm

    the inverse of

    • print if at least one in the reference set (e.g. symbols) matches

    is NOT

    • print if at least one in the reference set does NOT match

    but

    • print if NONE in the reference set matches.

    In other words, you should break the inner loop over z as soon as lista[j] is equal to symbols[z] and only print that it is a symbol once you have found no match in symbols.

    (I’m not providing explicit code here as this is homework)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small math problem I am trying to solve Given a number
I have an optimization problem as follows. Given an array of positive integers, e.g.
I have a small problem I can't seem to solve. I have a XML
I have a small app, where user can make some calculations and solve equations.
Ok, so here's the problem I have to solve. I need to write a
I have a problem that i cant solve :( I have a user control
Here is a problem I am trying to solve: I have an irregular shape.
I have been trying to solve this problem for a while, but couldn't with
I have an idea for how to solve this problem, but I wanted to
We're looking for an algorithm to solve this problem in under O(N). given two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.