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
Define the terms candidate key and primary key. Explain the difference between a primary key and a candidate key.
Shkiper50 [21]

Explanation:

Both Primary Key and Candidate Key are the attributes that are used to access tuples from a table. These (Primary key and Candidate key) are also can be used to create a relationship between two tables.

  • A Candidate Key can be any column or a combination of columns that can qualify as a unique key in the database. Each Candidate Key can qualify as a Primary Key.
  • A Primary Key is a column or a combination of columns that uniquely identify a record. The primary key is a minimal super key, so there is one and only one primary key in any relationship.

<em> The main difference between them is that a primary key is unique but there can be many candidate keys. </em>

I hope you find this information useful and interesting! Good luck!

5 0
4 years ago
We can save our data peremently on a
riadik2000 [5.3K]

Answer:

modem

Explanation:

hope it helps

4 0
3 years ago
Read 2 more answers
Which of the selections below does not represent a workable ip address?
defon

Answer: C

Explanation:

Because ipv4 ip addresses will be 4 sets of numbers for a maximum of 255 per set ie.  The highest ipv4 number is 255.255.255.255 and the answer C has 293 in it.

6 0
4 years ago
You must have an active ____ to test external links.
charle [14.2K]
Network & internet connection
4 0
4 years ago
jeremy wants to buy a horse. he is looking for a brown tennessee walker that is at least five years old and at least 15 hands ta
timurjin [86]

The numbers of records that will be displayed in response to his query is known to be zero (0).

<h3>What is a query?</h3>

A query is known to be a kind of a question or any form of request that is known to be for information that is often expressed in a formal manner.

Note that a database query is one that can be seen as an action query or a a kind of select query.

A select query is one that can help to get back data from a database. based on the question, Jeremy  is looking for a brown Tennessee walker and this is not among the option presented. Therefore the query will come back as zero.

Hence, The numbers of records that will be displayed in response to his query is known to be zero (0).

Learn more about query from

brainly.com/question/25694408

#SPJ1

7 0
1 year ago
Other questions:
  • You work as the Network Administrator for Perfect solutions Inc. The company has a Linux- based Network. You are a root user on
    15·1 answer
  • Assume you have functions f and g such that f(n) is O(g(n)). For each of the following statements, decide whether you think it i
    12·1 answer
  • Purpose of this program:
    12·1 answer
  • What is the advantage of saving a document as a PDF file?
    6·1 answer
  • A general rule for printing is to use _____ fonts for headlines and serif fonts for body text
    6·1 answer
  • Which of the following is time-dependant? Group of answer choices
    8·1 answer
  • 20. When you see ##### in a cell, you should
    8·1 answer
  • Why is failure an important part of life and the engineering design process?
    13·2 answers
  • Which function in Ecels tells how many numeric entries are there​
    7·2 answers
  • Read the following statements and select the
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!