subject

Fun with Characters Complete the checkCharacter() method which has 2 parameters: A String, and a specified index (int). The method checks the character at the specified index of the String parameter and returns a String based on the type of character at that location indicating if the character is a letter, digit, whitespace, or unknown character.

Ex: The method calls below with the given arguments will return the following Strings:
checkCharacter("happy birthday", 2) returns "Character 'p' is a letter"
checkCharacter("happy birthday", 5) returns "Character ' ' is a white space"
checkCharacter("happy birthday 2 you", 15) returns "Character '2' is a digit"
checkCharacter("happy birthday!", 14) returns "Character '!' is unknown"

CODE:
public class LabProgram {
public static String checkCharacter(String inputString, int index){
/* Type your code here. */
}

public static void main(String[] args) {
System. out. println(checkCharacter("happy birthday", 2));
System. out. println(checkCharacter("happy birthday", 5));
System. out. println(checkCharacter("happy birthday 2 you", 15));
System. out. println(checkCharacter("happy birthday!", 14));
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:30
Acomputer is a multipurpose device that accepts input, processes data, stores data, and produces output, all according to a series of stored . the processing unit of most modern computers is a(n) . the instructions that tell a computer how to carry out a task are referred to as computer , which are distributed as software. computers run three main types of software: software, system software, and development tools. an example of system software is a computer system, which is essentially the master controller for all the activities that a digital device performs. digital devices are constructed using tiny electronic components that represent data bits as electrical signals. the system unit houses the system board, which contains several circuits made from semiconducting materials. computers come in three popular form factors: component, , and slate. many of today's digital devices operate on battery power supplied by ion batteries. battery life and lifespan can be extended by following good battery management practices.
Answers: 3
question
Computers and Technology, 22.06.2019 19:00
Which parts of a presentation should be the most general? a. introduction and conclusion b. introduction and outline c. outline and conclusion d. outline and body
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
The graph shows median weekly earnings for full-time workers according to education level. which can you not conclude?
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
You know the right answer?
Fun with Characters Complete the checkCharacter() method which has 2 parameters: A String, and a s...
Questions
question
English, 03.04.2020 05:10
question
Mathematics, 03.04.2020 05:11
question
Biology, 03.04.2020 05:11
Questions on the website: 13722363