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]
2 years ago
7

Fun with Characters

Computers and Technology
1 answer:
Inessa [10]2 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
What are two type of physicals connection
netineya [11]
Two types of physical connection are:

A wired connection using a cable

A wireless connection using radio waves
7 0
3 years ago
It converts Assembly Language into machine language?​
docker41 [41]

Answer:

An assembler.

Explanation:

Input is (as with any programming language) files with lists of instructions (typically assembler mnemonics), output is a binary format representing these instructions in machine language.

6 0
2 years ago
Explain the following as used in Tally Accounting Software:
vaieri [72.5K]
Business transactions
3 0
2 years ago
What is the purpose of using a good e-mail technique?. Demonstrate your ability to write good e-mails b. Completely describe you
densk [106]
B. Completely describe your entire thought process
3 0
3 years ago
Which avenue may utilize video streaming, audio narration, print designs, and animation?
astra-53 [7]

Answer: is their any options to answer your question

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Universal Containers recently rolled out a Lightning Knowledge implementation; however, users are finding unreliable and unrelat
    6·1 answer
  • Discuss why mtv initially had a difficulty securing enough ads
    10·1 answer
  • What is the process of comparing data with a set of rules or values to find out if the data is correct?
    8·2 answers
  • . _______ view focuses on the text and content of a document, without much information on the page layout.
    5·1 answer
  • We are building a word processor and we would like to implement a "reflow" functionality that full-justifies text.Given a maximu
    12·1 answer
  • You have a large TCP/IP network and want to keep a host's real time clock synchronized. What protocol should you use?
    10·1 answer
  • Java Programming Using nested if statement For a student to be accepted in XYZ College, the student must meet the following requ
    5·1 answer
  • how risk can impact each of the seven domains of a typical IT infrastructure: User, Workstation, Local Area Network (LAN), Local
    7·1 answer
  • What is the datapath of add instruction?
    6·1 answer
  • How will technology help people with disabilities become more transportation independent?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!