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
KiRa [710]
3 years ago
11

Write code to print the location of any alphabetic character in the 2-character string passCode. Each alphabetic character detec

ted should print a separate statement followed by a newline.
Ex: If passCode is "9a", output is:

Alphabetic at 1
import java.util.Scanner;

public class FindAlpha {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
String passCode;

passCode = scnr.next();
/*Your solution goes here */
}
}
Computers and Technology
1 answer:
Mars2501 [29]3 years ago
5 0

Answer:

for (int i=0; i<passCode.length(); i++) {

           if ((passCode.charAt(i) >= 65 && passCode.charAt(i) <= 90) || (passCode.charAt(i) >= 97 && passCode.charAt(i) <= 122)) {

               System.out.println("Alphabetic at " + i);

           }

}

Explanation:

The rest of the code should be as above.

In order to check if the character is alphabetic or not, we need to use ASCII table. Characters are represented as integers in the ASCII table. For example "a" equals 97, "A" equals 65.

Then all we need to is to check if the character value in ASCII is in alphabetic ranges. If it is, print the index of the character.

You might be interested in
Chad, a computer programming student, just finished writing a computer program. In order to check whether the program performs t
dangina [55]
He'd need to use a compiler. 
3 0
3 years ago
Read 2 more answers
HAve a good week lads, good luck on work :D
Leno4ka [110]

Answer:

v; its alright.

Explanation: none v;

8 0
3 years ago
Read 2 more answers
Help me please I dont have enough points for people just to get these for free
Gekata [30.6K]

Answer:

help me please I dont have enough points for people just to get these for free

Sam is a movie director. He has asked his storyboard artist to create an image of the central character looking ecstatic after receiving an award. What type of shot does the director need from the storyboard artist?

A. long shot

B. point of view shot

C. reaction shot

D. jump cut​

A is the asnwer

3 0
2 years ago
What is the index of 7 in this list?<br> [5, 6, 10, 7, 3, 2.51]
kotykmax [81]
5 or 7 I believe Good luck!
6 0
2 years ago
Read 2 more answers
PL Technologies suffered considerable data loss when its database was infected by a virus. George, an operations personnel, atte
Luba_88 [7]

Answer:

Recovery is the correct answer to the given question.

Explanation:

Recovery is used when the data is lost from the database in any issue Database Recovery is giving the data to returning in its consistent state of the database.

When George sees that the  PL Technologies is suffered from considerable data loss due to it is infected by a virus then George retrieving the information and the data by using the recovery process  

6 0
3 years ago
Other questions:
  • What is the use of word art?
    10·1 answer
  • Which are considered regulatory agencies? Check all that apply. WHO PPO HMO CMS CDC NIOSH
    11·2 answers
  • Which of the following illustrations is depicted in the icon that's used to access Windows Help and Support files?
    13·1 answer
  • What number system do people in America use?
    10·2 answers
  • Siapa mahapatih brainly.com atau yg disebut Brainly Amerika Serikat ?​
    5·1 answer
  • What is the device manager in windows 8?
    14·1 answer
  • What would be the best tool to display the following information from a basketball game?
    6·1 answer
  • Gn guys have an Amazing day!
    12·2 answers
  • Tamara is writing a program to organize students in a class and needs to use operators to organize student grades, then compare
    9·1 answer
  • Which of the following was the first computer-animated film to win animated film to win an academy award?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!