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
All of the Internet in your country disappears. What happens next?
Talja [164]

Answer:

It is most likely that in a tech surrounded environment there would be an apacolypse, not necessarily a man hunting man apacolypse but it would cause a huge panic throughout that country because government could not communicate which is what leaves people with a safeplace.

Explanation:

please mark as brainliest xx hope it helps <3

if you really like this topic watch into the forest on netflix, it has the same premise except its not that internet disappears its electricity.

4 0
3 years ago
I need help with question 3 I’ll give brainliest
Semmy [17]

Answer:

D) Engineering and Technology

Explanation:

Brent Designs or <em>Engineers </em>the equipment or<em> Technology </em>that is used to keep the plant safe.

7 0
3 years ago
Read 2 more answers
Wat kind o mouse pleese hep meh​
Trava [24]

Answer:

It's is a razer Basilisk

4 0
4 years ago
Tysm for Ace! :O<br> Hurray!
professor190 [17]

Answer:

Good job!! You deserve it.

Explanation:

3 0
3 years ago
Read 2 more answers
the history of forensics webquest answer key pdf what did the following people contribute to forensics
Tatiana [17]

A person that is known to have contribute to Forensics is Mathieu Orfila

<h3>Who is known as the father of forensic toxicology and why?</h3>

Mathieu orfila is said to be called  the father of toxicology due to the fact that he was the onw who was known to have published his work as the first scientific treatise on the act of knowing of poisons and as well as their effects on animals.

He is known to have done the work that set up forensic toxicology as a legitimate scientific discipline.

Hence, A person that is known to have contribute to Forensics is Mathieu Orfila

Learn more about Mathieu Orfila from

brainly.com/question/21073600

#SPJ1

3 0
2 years ago
Other questions:
  • Brock wants to use several images on his hiking blog. However, the images are making his pages load very slowly. Explain to Broc
    6·1 answer
  • Im sad cheer me up please
    13·2 answers
  • Why is personal responsibility important when considering technology?​
    14·2 answers
  • If my computer is next to my book, what preposition would I use?<br> O xià<br> 0 shàng<br> pangbian
    7·1 answer
  • In attempts to improve their contribution to the environment, a company decided to adapt to green computing. Which of these tech
    15·1 answer
  • . Convert your age into binary and then to hexadecimal. Show your work.
    5·1 answer
  • Given the 32-bit binary number:
    13·1 answer
  • Define E-Mail Write any 4 special features of E-Mail ​
    13·1 answer
  • Swapping Order of Vowels Write a program to swap the order of the vowels in a given word. For example, if the word is programmin
    10·1 answer
  • Write a program which will -
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!