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]
2 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]2 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
Determine which program you would recommend each of the customers should use. There are multiple correct answers so please inclu
Lana71 [14]
  1. Since Adult A has been asked to create a website for their church, the most appropriate software to use is Sublime Text because it can be used to type all of the instructions to be executed.
  2. Adult B should use Adobe Photoshop to create a flyer about an upcoming social gathering for her workplace.

<h3>What is a text editor? </h3>

In Computer technology, a text editor can be defined as a tool which is typically designed and developed to enable a software or web developer in typing and create the instructions to be used in a software or website such as a blog.

Sublime Text is a very good example of a text editor and should be used by Adult A to create a website for his or her church because it can be used to type all of the instructions that need to be executed and provides indentation by default.

On the other hand (conversely), Adult B should use Adobe Photoshop to create a flyer about an upcoming social gathering for her workplace because it is arguably the best graphics design software.

Read more on text editor here: brainly.com/question/4004088

#SPJ1

5 0
1 year ago
What profession do you prefer to have in the future? In what way could you make an impact on society using the Internet?
natima [27]

Answer:

lawyer

Explanation:

by helping my society in terms of solving land cases that have been not settled in our history

7 0
2 years ago
While there are a some exceptions such as an if-statement, Scheme has one primary syntax () a) True b) False
aivan3 [116]

Answer:

Hence the answer is False.

Explanation:

While there are some exceptions such as an if-statement, the scheme has one primary syntax (<thing I want to do> <things I want to do it to>).

The given statement is False.

4 0
2 years ago
Jim, the IT director, is able to complete IT management task very well but is usually two weeks late in submitting results compa
oee [108]

Answer:Effective but not efficient

Explanation:

Jim is effective because he was able to complete the IT tasks well but he is not efficient because he didn't submit the result on time because being efficient includes management of time.

5 0
3 years ago
b. Suppose instead that Miller had written a routine to constantly change his assigned IP address to other addresses used by his
amm1812

Answer:

It wouldn't be legal practice of SLS’

Explanation:

The Internet service address is the address of the internet where we getting the address of the internet sometimes it is known as the computer address of the host machine.  

Since the miller has changed the Ip address continuously in a constant manner also the other address which is giving by the internet service provider  The transfer of IP address, Miller will be able to receive their network. That sort of practice is not legal of SLS.

5 0
3 years ago
Other questions:
  • Which tab provide text formatting features
    11·1 answer
  • How do you change exposure to allow for greater DoF
    10·1 answer
  • Which is a good guideline to follow when choosing a background for your slides?. . A. Use a different background for each slide.
    8·1 answer
  • Problem 5. (Greatest Common Divisor) Write a program gcd.py that accepts p (int) and q (int) as command-line arguments, and writ
    13·1 answer
  • Communication is the transmission of messages to large audiences.
    14·1 answer
  • WILL UPVOTE ALL
    10·1 answer
  • Blending two or more colours is called​
    6·1 answer
  • <img src="https://tex.z-dn.net/?f=%20%5Cfrac%7Bx%7D%7B1%20%2B%20x%7D%20%20%2B%20%20%5Cfrac%7Bx%20%2B%201%7D%7Bx%7D%20%20%3D%20%2
    15·2 answers
  • Describe from an administrator perspective what is necessary to prepare a storage device for access by a user.
    14·1 answer
  • MLB The Show 17, which simulates professional baseball games, and Madden Football, which simulates professional football games,
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!