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
2.
inn [45]

Answer:

True

Explanation:

Readability is how easy it is to read words, phrases, blocks of copy such as a book, a web page or an article. Legibility is a measure of how easy it is to distinguish one letter from another in a particular typeface.

Your welcome

5 0
3 years ago
5. Write a program to remove any duplicate letters from a word and display the new word maintaining the original order. For exam
dexar [7]

Answer:

word = input('Enter a single word: ', 's');

n = length(word);

nodupWord = [];

for i = 1:n

  dup = false;

  c = word(i);

  for j = 1:i-1

      if word(j) == c

          dup = true;

          break;

      end

  end

  if ~dup

      nodupWord = [nodupWord, c]; %add the non-duplicate char to end

  end

end

disp(['Adjusted word: ', nodupWord])

Explanation:

The code is in Python.

3 0
3 years ago
What is the best file manager for windows 10?
SOVA2 [1]

In my opinion, XYplorer is the best

7 0
3 years ago
Read 2 more answers
Which of the following types of tool should be used only on round work, such as rigid or IMC conduit?
Dafna11 [192]
Its C. A pipe wrench 
6 0
3 years ago
Read 2 more answers
A force of 50n acts on a body of mass 5kg. calculate acceleration produced .​
guapka [62]

Answer:

Force = 50n

mass = 5kg

Force = m * acc

50 = 5 * A

A = 50/5

A = 10 m/s^2

HOPE IT HELPS!!!

Explanation:

7 0
3 years ago
Other questions:
  • You created a database related to medicinal plants and their uses. For every plant, you would like to enter a description about
    11·1 answer
  • 3. What is the purpose of the conclusion in an expository essay? (1 point)
    8·2 answers
  • When entering a formula into a cell, you begin with are calculations a spreadsheet program applies to data. are preset calculati
    9·1 answer
  • You want to establish the validity of a test designed for computer technicians using a predictive criterion-related validation s
    9·1 answer
  • What is the purpose of the GETPIVOTDATA function?
    13·2 answers
  • How much do high-end earners make as power plant operators? Type answer as numerical number.
    14·1 answer
  • 19 dollar fortnite giftcard who wants it
    15·2 answers
  • If you forget your privacy password what will you do if the ask this question what is the name of one of your teacher?​
    12·1 answer
  • Complete the sentence with the correct response.
    13·1 answer
  • Explain with examples what is software​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!