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]
4 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]4 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
Jerome falls sick after eating a burger at a restaurant. After a visit to the doctor, he finds out he has a foodborne illness. O
babunello [35]

Answer: food poisning

Explanation:

either the food wasnt

cooked properly or the food was out of date and went bad

3 0
3 years ago
Which type of data is is usually collected as numerical data that can be presented in a graph or chart?
Natali5045456 [20]

Answer:

Quantitative data

Explanation:

Quantitative data is information about quantities; that is, information that can be measured and written down with numbers. Some other aspects to consider about quantitative data: Focuses on numbers. Can be displayed through graphs, charts, tables, and maps.

8 0
3 years ago
Which of the following is an example of indirect perception checking?
Debora [2.8K]
When we say indirect perception checking, this is when we make confirmations about the information that we have gathered through passive perception. This is done by collecting information that may either support or negate our interpretation. Based on the given situations above, the one that makes a best exaple of what indirect perception checking is, is this: <span>observing your mother’s actions to see if she is angry. Answer is B.</span>
7 0
3 years ago
Read 2 more answers
Can u write a python program with this output
cestrela7 [59]

Answer:

Not exact, but it will help.

Explanation:

do something like this.

       print("""

       this program will help you plan your garden.

       First, we need some information about the dimensions you want.

       """)

       while True:

           try:

               response = int(input("Please enter the side length for your garden (in feet) : "))

           except ValueError:

               print("(!)Please Enter A Number(!)")

               print("")

               continue

           if str(response) == "":

               continue

           else

               length = int(response)

               break

repeat stuff like that up above for the rest, and then you can decide what to do with the variables and how they need to be multiplied for the output. Good luck!

                       

3 0
3 years ago
1. PGP encryption can be performed from the command line as well. What is the PGP command line syntax to encrypt the my-message.
bekas [8.4K]

Answer:

1. From the command prompt, type:

pgp --encrypt "my-message.txt" --recipient "Sean" --output "secret-message.txt.gpg"

2. Press Enter.

Explanation:

From the command line, the above command is entered and Enter is pressed.

The command start with pgp, then it has different options:

--encrypt: this specifies the input file to be encrypted

--recipient: this specifies the specific user to which the file is been encrypted

--output: this specifies the name to which the output (encrypted file) is saved.

8 0
3 years ago
Other questions:
  • On computer X, a nonpipelined instruction execution would require 12 ns. A pipelined implementation uses 6 equal-length stages o
    9·1 answer
  • How do you create a table in an existing database on Microsoft Access?
    7·2 answers
  • Sharon is a skilled professional who operates logging equipment.
    12·2 answers
  • Keyboard question: <br> How do I make the 'congruent to' symbol on this keyboard?
    8·1 answer
  • A __________ is typically stored in a JAR file and contains one or more packages that you want to make available to other projec
    15·1 answer
  • Rain forests clean the air by producing oxygen. Some rain forest plants have healing properties, and can be used as medicine. Ra
    12·1 answer
  • I WILL GIVE BRANLIST
    8·2 answers
  • Can you create energy?
    11·1 answer
  • Group of programs are software <br>​
    11·1 answer
  • A eclipse occurs at a full moon when the moon passes between earth and the sun
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!