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
Agata [3.3K]
4 years ago
13

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 1import 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:
damaskus [11]4 years ago
4 0

Answer:

The code to this question can be described as follows:

Code:

char c1,c2; //defining char variable

c1=passcode.charAt(0);  // hold the value of first character

c2=passcode.charAt(1); // hold the value of first character

//defining conditional statement to check value

if(Character.isLetter(c1))// check character is alphabet

{

System.out.println("Alphabetic is available in 0 position:"); //print message

}

else if(Character.isLetter(c2))

{

System.out.println("Alphabetic is available in 1 position:"); //print message

}

Explanation:

Description of the code:

In the above code, two char variable "c1 and c2" is declared, in which these variable holds the first and second character value.

In the next step, if the conditional statement is used that check the input char is a letter or not.

To check these values "isLetter" method is used, that checks value is a letter or prints its location.  

You might be interested in
Define a class Person that represents a person. People have a name, an age, and a phone number. Since people always have a name
katrin2010 [14]

Answer:

public class Person {

   String name;

   int age;

   String phoneNumber;

   public Person(String name, int age, String phoneNumber){

          this.name = name;

          this.age = age;

          this.phoneNumber = phoneNumber;

   }

}

Explanation:

The code above is written in Java.

The following should be noted;

(i) To define a class, we begin with the keywords:

<em> public class</em>

This is then followed by the name of the class. In this case, the name is Person. Therefore, we have.

<em>public class Person</em>

<em />

(ii) The content of the class definition is contained within the block specified by the curly bracket.

(iii) The class contains instance variables name, age and phoneNumber which are properties specified by the Person class.

The name and phoneNumber are of type String. The age is of type int. We therefore have;

<em> String name;</em>

<em>int age;</em>

<em>String phoneNumber;</em>

(iv) A constructor which initializes the instance variables is also added. The constructor takes in three parameters which are used to respectively initialize the instance variables name, age and phoneNumber.

We therefore have;

<em>public Person(String name, int age, String phoneNumber){</em>

<em>           this.name = name;</em>

<em>           this.age = age;</em>

<em>           this.phoneNumber = phoneNumber;</em>

<em>    }</em>

(v) Notice also that a constructor has the same name as the name of the class. In this case, the constructor's name is Person.

8 0
4 years ago
Read 2 more answers
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
​"To busy multitaskers who need help remembering​ things, Evernote is a digital content management application that makes it eas
wolverine [178]

Answer:

positioning statement

Explanation:

Based on the information provided within the question it can be said that this is an example of a positioning statement made by Evernote. A companies positioning statement refers to a statement given that explains how the companies product or service meets the specific needs that the consumers have, as well as how it does it better than the competition. Which is what Evernote is doing by stating that they can capture moments and ideas from any device on hand.

5 0
3 years ago
Your job is to write a basic blurring algorithm for a video driver. The algorithm will do the following: it will go through all
nekit [7.7K]
I’m pretty sure answer is B let me know if I’m wrong
4 0
4 years ago
Inattentional blindness occurs when individuals do not observe certain objects or events because they are focused on something e
PSYCHO15rus [73]
The answer is True have a good day
5 0
4 years ago
Read 2 more answers
Other questions:
  • Select the correct answer.
    8·1 answer
  • Which type of factories began to flourish in the late eighteenth century
    5·1 answer
  • A network engineer is configuring a network to be able to relay IPv6 packets. The network only supports IPv4 and does not have d
    11·1 answer
  • A(n) _____ is a computer network that uses Internet Protocol technology to share information, operational systems, or computing
    12·1 answer
  • 4.In order for a driver to graduate from a learner’s license to an operator’s license, how many hours of driving need to be docu
    11·1 answer
  • A section in a history book describing the conditions and causes of the Great Depression in the Midwest in the 1930s. a. Enterta
    15·1 answer
  • Any song recommendations, pls dont say 6ix9ine or lil pump
    5·2 answers
  • Harry needs to make a presentation on packaging prototypes for a new product. Which presentation software elements can be use to
    9·1 answer
  • A list cannot use appendleft but a _____ can.
    11·1 answer
  • Help me with this someone hurry due in 8 mins
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!