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
maksim [4K]
3 years ago
8

Write an application that uses String method region-Matches to compare two stringsinput by the user. The application should inpu

t the number of characters to be compared andthe starting index of the comparison. The application should state whether the comparedcharacters are equal. Ignore the case of the characters when performing the comparison.
Computers and Technology
1 answer:
SOVA2 [1]3 years ago
3 0

Answer:

Explanation:

The following program creates a function called region_Matches that takes in two strings as arguments as well as an int for starting point and an int for amount of characters to compare. Then it compares those characters in each of the words. If they match (ignoring case) then the function outputs True, else it ouputs False. The test cases compare the words "moving" and "loving", the first test case compares the words starting at point 0 which outputs false because m and l are different. Test case 2 ouputs True since it starts at point 1 which is o and o.

class Brainly {

   public static void main(String[] args) {

       String word1 = "moving";

       String word2 = "loving";

       boolean result = region_Matches(word1, word2, 0, 4);

       boolean result2 = region_Matches(word1, word2, 1, 4);

       System.out.println(result);

       System.out.println(result2);

   }

   public static boolean region_Matches(String word1, String word2, int start, int numberOfChars) {

       boolean same = true;

       for (int x = 0; x < numberOfChars; x++) {

           if (Character.toLowerCase(word1.charAt(start + x)) == Character.toLowerCase(word2.charAt(start + x))) {

               continue;

           } else {

               same = false;

               break;

           }

       }

       return same;

   }

}

You might be interested in
SHOW ME SOME C++ TUTORIALS?
german
Google c++ tutorial. Cplusplus and Tutorials Point both have some good resources
4 0
4 years ago
A destination port number at the transport layer identifies which application on a computer should receive the data transmission
Lady_Fox [76]

A destination port number at the transport layer identifies which software application on a computer should receive the data transmission: True.

<h3>What is the transport layer?</h3>

The transport layer can be defined as one of the seven layers of the open systems interconnection (OSI) model and it is responsible for routing messages through an active computer network while selecting the best transmission path from the source to the destination device.

In Computer networking, a destination port number at the transport layer is saddled with the responsibility of identifying which software application on a computer should receive the data transmission.

Read more on transport layer here: brainly.com/question/26177113

#SPJ12

7 0
2 years ago
What are the two main charaters from maid sama?
Gennadij [26K]

Answer:

Takumi Usui and Misaki Ayuzawa

Explanation:

don't know why this is here

8 0
3 years ago
Read 2 more answers
Which is true of effective passwords?
mylen [45]

Answer:

It is either A. or D.

4 0
3 years ago
Social media allows businesses to use which proven marketing principle? Select one: a. Reciprocity b. Social proof c. Authority
riadik2000 [5.3K]

B is the most reasonable one

3 0
3 years ago
Read 2 more answers
Other questions:
  • The ________ of the operating system enables users to communicate with the computer system. modem window network adapter card us
    14·1 answer
  • Whats a computer scientist.
    5·2 answers
  • Mr. Mathis asked his students to add a comment to a cell the students recorded the steps they followed in a chart. Which student
    12·2 answers
  • Which of the following do you need to remeber about true/false questions?
    12·1 answer
  • Which of these describes the functionality of a database? Check all of the boxes that apply.
    10·2 answers
  • Which best describes color blindness?
    8·1 answer
  • When replacing a system board in a laptop, which feature is a must?
    7·1 answer
  • An F-1 ____________ may be authorized by the DSO to participate in a curricular practical training program that is an__________
    8·1 answer
  • Why do you think Jacinda believed what people told her about her own beauty? Even if you understand that what you see on social
    13·1 answer
  • This is a graded practice activity. This is not an actual quiz.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!