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
What does the following code print?
Crank

Answer:

It throws an error.

the public class needs a name.

like this:

public class G{ public static void main(String[] args) {

   int x=5 , y = 10;

   if (x>5 && y>=2) System.out.println("Class 1");

   else if (x<14 || y>5) System.out.println(" Class 2");

   else System.out.println(" Class 3"); }// end of main

   }

if you give the class a name and format it, you get:

Class 2

Explanation:

3 0
3 years ago
What happens if you create multiple accounts just to get points faster?
balandron [24]
I don’t think it will work sadly. You can probably accumulate points though on your pre existing account. Hope that helps!
8 0
3 years ago
Use the arr field and mystery () method below.
kolezko [41]

Answer:

The sum of all positive even values in arr

Explanation:

We have an array named arr holding int values

Inside the method mystery:

Two variables s1 and s2 are initialized as 0

A for loop is created iterating through the arr array. Inside the loop:

num is set to the ith position of the arr (num will hold the each value in arr)

Then, we have an if statement that checks if num is greater than 0 (if it is positive number) and if num mod 2 is equal to 0 (if it is an even number). If these conditions are satisfied, num will be added to the s1 (cumulative sum). If num is less than 0 (if it is a negative number), num will be added to the s2 (cumulative sum).

When the loop is done, the value of s1 and s2 is printed.

As you can see, s1 holds the sum of positive even values in the arr

7 0
3 years ago
Which of the following is NOT an example of written communication?
Veronika [31]

Answer:A conversation between co-workers

Explanation:

4 0
2 years ago
PLTW IM Chapter 1.2-1.3 i need this please
Luden [163]

<u>Answer:</u>

<em><u>Biomedical Science</u></em>

<em><u>The application of the principles of the natural sciences, especially biology and physiology to clinical medicine</u></em>

<em><u>Control group</u></em>

<em><u>The group in an experiment where the independent variable being tested is not applied so that it may serve as a standard for comparison against the experimental group where the independent variable is applied.</u></em>

<em><u>Dependent Variable</u></em>

<em><u>The measurable affect, outcome, or response in which the research is interested.</u></em>

<em><u>Experiment</u></em>

<em><u>A research study conducted to determine the effect that one variable has upon another variable</u></em>

<em><u>Forensic Science</u></em>

<em><u>The application of scientific knowledge to questions of civil and criminal law</u></em>

<em><u>Hypothesis</u></em>

<em><u>Clear prediction of anticipated results of an experiment</u></em>

<em><u>Independent Variable</u></em>

<em><u>The variable that is varied or manipulated by the researcher</u></em>

<em><u>Negative control</u></em>

<em><u>Control group where the conditions produce a negative outcome. Negative control groups help identify outside influences which may be present that were not accounted for when the procedure was created</u></em>

<em><u>Personal protective equipment</u></em>

<em><u>Specialized clothing or equipment, worn by an employee for protection against infectious materials.(as defined by OSHA)</u></em>

<em><u>Positive control</u></em>

<em><u>Group expected to have a positive result, allowing the researcher to show that the experiment set up was capable of producing results.</u></em>

<em><u>Adenine</u></em>

<em><u>A component of nucleic acids, energy carrying molecule such as ATP, and certain co enzymes. Chemically it is a purine base.</u></em>

<em><u>Chromosome</u></em>

<em><u>Any of the usually linear bodies in the nucleus that contain genetic material.</u></em>

<em><u>Cytosine</u></em>

<em><u>A component of nucleic acids that carries hereditary information in DNA and RNA in cells . Chemically it is a pyrimidine base.</u></em>

<em><u>Deoroxyribonucleic acid</u></em>

<em><u>A double-stranded helical nucleic acid molecule capable of replicating and determining the inherited structure of a cell proteins</u></em>

<em><u>Gel electrophoresis</u></em>

<em><u>The separation of nucleic acids or proteins, on the basis of their size and electrical charge, by measuring their movement through an electrical field in a gel.</u></em>

<em><u>Gene</u></em>

<em><u>A discrete unit of hereditary information consisting of a specific nucleotide sequence in DNA.( or RNA in some viruses).</u></em>

<em><u>Guanine</u></em>

<em><u>A component of nucleic acids that carries hereditary information in DNA and RNA in cells. Chemically it is a purine base.</u></em>

<em><u>Helix</u></em>

<em><u>Something in spiral form.</u></em>

<em><u>Model</u></em>

<em><u>A simplified version of something complex used, for example, to analyze and solve problems or make predictions.</u></em>

<em><u>Nucleotide</u></em>

<em><u>A building block of DNA, consisting of a 5 carbon sugar convalently bonded to a nitrogenous base and a phosphate group.</u></em>

<em><u>Restriction enzymes</u></em>

<em><u>A degradative enzyme that recognizes specific nucleotide sequences and cuts up DNA</u></em>

<em><u>Restriction fragment length polyphorisms (RFLPs)</u></em>

<em><u>Differences in DNA sequences on homologous chromosomes that can result in different patterns of restriction fragment lengths (DNA segments resulting from treatment with restriction enzymes)</u></em>

<em><u>Thymine</u></em>

<em><u>A component of nucleic acid that carries hereditary information in DNA cells. Chemically, it is a pyrimidine base</u></em>

<em><u>Autopsy</u></em>

<em><u>An examination of the body after death usually with such dissections as will expose the vital organs for determining the cause of death</u></em>

<em><u>Bibliography</u></em>

<em><u>a document showing all the sources used to research information</u></em>

<em><u>Citation</u></em>

<em><u>A written reference to a specific work by a particular author or creator which identifies the document in which the work may be found</u></em>

<em><u>Documentation</u></em>

<em><u>The act of creating citations to identify resources used in writing a work</u></em>

<em><u>Health Insurance Portability and Accountability Act (HIPAA)</u></em>

<em><u>A comprehensive set of standards and practices designed to give patients specific rights regarding their personal health information</u></em>

<em><u>Medical examiner</u></em>

<em><u>A physician who performs an autopsy when death may be accidental or violent. He/she may also serve in some jurisdictions as the coroner.</u></em>

Explanation:

This is what I found when I searched up <u>pltw chapter 1.2-1.3 answers.</u>

I did this because there was not really a question in there.

PS:

I'm sorry if this is too long for you to read.

Give me brainliest, if you want to, that is.

7 0
2 years ago
Other questions:
  • 13. You're expecting an important call from Mr. Suarez, a potential customer. While waiting for this call, your supervisor calls
    15·1 answer
  • Can you know what time someone retweeted
    5·1 answer
  • . A program that can run more than one thread at once is called:
    9·1 answer
  • What type of electronic monitoring involves an offender being contacted periodically by telephone or beeper to verify his or her
    5·1 answer
  • Which wireless communication technology is most likely used when synchronizing device information to an automobile?
    9·1 answer
  • What laptops can you get for 2500$ and should mostly using Microsoft applications.
    14·2 answers
  • ___________ key encryption in wep uses the rc4 encryption algorithm.
    9·1 answer
  • Why do I keep getting points if I haven't answered anything? I don't want points.
    12·1 answer
  • Which device allows you to convert sounds into digital format to be used on the computer​
    8·1 answer
  • My computer is being weird, Everytime I begin to type something on here it keeps adding a letter to the beginning of my sentence
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!