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
spin [16.1K]
3 years ago
9

Write an expression to detect that the first character of userinput matches firstLetter.

Computers and Technology
1 answer:
IrinaVladis [17]3 years ago
8 0

Answer: Provided in the explanation segment

Explanation:

Below is the code to run this program.

we have that the

Program

import java.util.Scanner;

public class CharMatching {

  public static void main(String[] args) {

      //Scanner object for keyboard read

      Scanner scnr=new Scanner(System.in);

      //Variable for user input string

      String userInput;

      //Variable for firstletter input

      char firstLetter;

      //Read user input string

      userInput=scnr.nextLine();

      //Read first letter from user

      firstLetter=scnr.nextLine().charAt(0);

      //Comparison without case sensititvity and result

      if(Character.toUpperCase(firstLetter)==Character.toUpperCase(userInput.charAt(0))) {

          System.out.println("Found match: "+firstLetter);

      }

      else {

          System.out.println("No match: "+firstLetter);

      }

  }

}

Output

Hello

h

Found match: h

cheers i hope this helped !!!

You might be interested in
Given a class called Measure that has the methods and data as specified, choose the correct code to satisfy the requirements of
Nina [5.8K]

Answer:

D

Explanation:

7 0
3 years ago
B. Differentiate Operation System from other software. give me 4-5 sentences pls.
borishaifa [10]

Answer:

it is a

Explanation:

i did the test

8 0
3 years ago
Read 2 more answers
What are the basic tools for coding HTML manually?
ipn [44]
The answer should be C, you need a text editor to write out the code, and then a web browser to view what the code creates.
5 0
4 years ago
Read 2 more answers
In the source-code file containing a class’s member function definitions, each member function definition must be tied to the cl
jenyasd209 [6]

Answer:

Binary Scope Resolution Operator

Explanation:

The :: (scope resolution) operator is used to get hidden names due to variable scopes so that you can still use them. The scope resolution operator can be used as both unary and binary. Fortunately, in this context we're not dealing with hidden contents; thus the Binary applies better than the Unary.

Cheers

5 0
3 years ago
Additional rows and columns are inserted into a table using the
Paladinen [302]
The Option D , Table Tools Insert
6 0
3 years ago
Other questions:
  • Which is the most important reason you should properly cite information that you obtain from an Internet search? Question 2 opti
    8·1 answer
  • A ________ pays out cash flows from a collection of assets in different tranches, with the highest-rated tranch paying out first
    8·1 answer
  • ________ computers are specially designed computer chips that reside inside other devices, such as a car. Select one: A. Tablet
    11·2 answers
  • Which function in Spell Checker should Patrick use if he makes the same mistake frequently when typing emails?
    11·1 answer
  • What is a correlation and how does it relate to inferential error?
    5·1 answer
  • Write a Python program that reads the CSV file, compares the population estimates of every row for 2010 and 2017 and computes th
    10·1 answer
  • Grace is performing a penetration test against a client's network and would like to use a tool to assist in automatically execut
    13·2 answers
  • Help please! Coding!
    9·1 answer
  • Which of the following guidelines about the subject line of e-mail messages is most appropriate?
    15·2 answers
  • The set of coordinating colors applied to backgrounds, objects, and text in a presentation is called:
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!