1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yuki888 [10]
3 years ago
7

Fun with Characters

Computers and Technology
1 answer:
Inessa [10]3 years ago
4 0

The program is an illustration of conditional statements.

Conditional statements are statements whose execution is dependent on the truth value of the condition.

The checkCharacter() method in Java, where comments are used to explain each line is as follows:

//This defines the checkCharacter() method

public static String checkCharacter(String inputString, int index){

  //This checks if the character at the index, is a digit

  if(Character.isDigit(inputString.charAt(index))){

      //If yes, it returns "Digit"  

      return "Character "+inputString.charAt(index)+" is a digit";

  }

  //This checks if the character at the index, is a letter

  else if(Character.isLetter(inputString.charAt(index))){

      //If yes, it returns "letter"

      return "Character "+inputString.charAt(index)+" is a Letter";

  }

  //This checks if the character at the index, is a white space

  else if(inputString.charAt(index) ==' '){

      //If yes, it returns "white space"

      return "Character "+inputString.charAt(index)+" is a white space";

  }

  #If all the above conditions are false

   else{

      //If yes, it returns "unknown character"

      return "Character "+inputString.charAt(index)+" is an unknown character";

  }

}

The string to return depends on the character at the index.

Read more about similar programs at:

brainly.com/question/25127567

You might be interested in
Opinion on sandshrew​
Alex

Answer:Sandshrew is cute

Explanation:

3 0
3 years ago
If you want to prioritize downloads of your mobile app instead of visits to your mobile site, you should: a) add a sitelink exte
scoray [572]

Answer:

create a Universal App campaign

3 0
3 years ago
What is done when Python complies your program
alexgriva [62]

Answer:

It makes

Explanation:

it run the program

4 0
3 years ago
Read 2 more answers
And what way do you mixed and market economy support the ideals of democracy​
PolarNik [594]
Mixed and market economies protect individuals' ability to make their own economic decisions.
5 0
3 years ago
Which measure should you take for the periodic maintenance of your computer?
WITCHER [35]
I believe the answer is annual maintenance
Hope this helps :p
6 0
3 years ago
Read 2 more answers
Other questions:
  • When doing a complex presentation, which of the following would be the best tool to begin designing your presentation?
    11·2 answers
  • What is A/B Testing
    10·2 answers
  • One random part of Chess is whether the white side or the black side moves first? A. True B. False
    10·2 answers
  • What did Fulton design in addition to the steamboat
    5·1 answer
  • "In an artificial neural network, what input values will cause the neuron below to produce an output of 1". Group of answer choi
    12·1 answer
  • Suppose you are consulting for a bank that's concerned about fraud detection, and they come to you with the following problem. T
    13·1 answer
  • What are two major techniques involved in green computing
    14·1 answer
  • What is the cell reference for row 22 and column B? __________<br><br> In excel
    5·1 answer
  • Which of the following Access objects provides a user-friendly data entry method?
    7·1 answer
  • What is 11x12x12x14x15x16
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!