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
What is the name of small programs stored on the hard drive that tell the computer how to communicate with a specific hardware d
Katena32 [7]
Small programs stored on the harddrive that provide basic functionality for he devices listed would be called Hardware Drivers.
I hope this helps!
5 0
4 years ago
You have just set up a new wireless network at your house, and you want to determine whether your Linux laptop has connected to
Anvisha [2.4K]

Answer:

ifconfig -a

Explanation:

ifconfig is used to configure the system's kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging, or when system tuning is needed. If no arguments are given, ifconfig displays the status of the system's active interfaces.

-a display all interfaces which are currently available, even if down. source manpages: ifconfig.

8 0
3 years ago
I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRIST AND CORRECT
forsale [732]

Answer:

Act like search engines

Explanation:

They will give you intel on about basically anything and they have their own opinion on it aswell‍♀️

4 0
3 years ago
Read 2 more answers
Twenty years ago, most games were sold in brick and mortar stores. How did independent game developers get their games into thes
Svetlanka [38]

Answer: by working with a publisher who would help the developer bring their games to stores and then market them and get as much exposure and traction as possible

Explanation:

Publishers were and are still important in the gaming world even if they have now increasingly moved online. Publishers have a reputation and with this reputation comes access to a wide array of services that enable them to sell games.

This was the same when most stores were brick and mortar. One would sign a deal with a publisher who through their expertise would help the game get to market and give it publicity so that it can be sold.

6 0
3 years ago
List the five parts of a system.describe them.
dem82 [27]
The five main parts of a system are: 

1. The CPU
The CPU is the brain of the computer. It is the main part that does all th thinking and processing.

2. RAM
which stands for Random Access Memory. As implied in its name, it can be accessed at random times by the CPU. When you open a program, all the scripts and codes that are running need to be run of a separate memory bank. Thus, the RAM takes part.

3. Drives
Hard Drives, SSDs, USB Drives, and SD cards are all forms of main computer memory. That is where the computer stores the OS, your files, and its instructions.

4. Inputs/Outputs
By inputs and outputs i mean hardware, like Speakers (ouput), Monitors (output), Keyboard (input), and Mouse (input).

5. OS
The OS is the Operating System (e.g. Windows, Linux, Mac), which is the main instructions for the computer. It is what makes your computer usable.
3 0
3 years ago
Other questions:
  • The first thing to do when your computer gives you a error message is
    7·2 answers
  • Which of the following statements is correct? A. The columns will be listed in the results in the same order they are stored in
    7·1 answer
  • Which scientific law states that if a light source radiates isotropically, the light intensity falls off the further you get fro
    5·1 answer
  • Research different ways that 3D printing is used in society. Tell us about the items that are 3D printed.
    15·2 answers
  • I need help in creating a Java Program; To calculate the chapter from which you solve the programming exercise, below are the re
    7·1 answer
  • Sometimes your Internet is slow and sluggish, what are some common problems that affect network functionality. Check all that ap
    14·1 answer
  • Given: int[][] values = new int[4][5] Using the statement above, write a nested loop to set values as follows: (3 pts) [0] [1] [
    13·1 answer
  • A successful web-based strategy that helps a business spread the word about its website and products is called:
    15·1 answer
  • Adobe Indesign project 4 museum indesign file. The instructions are 70 pages long I cant sit still long enough to read them
    11·1 answer
  • Missing only a few days of school will not impact your grades.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!