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
Anton [14]
3 years ago
14

A multiplication problem is provided as a string using the format 'x times y'. Create a function called MultiplyString to extrac

t the numbers that should be multiplied from a character vector called inputCharVect, and then assign the product to the variable multResult.
Mathematics
1 answer:
Varvara68 [4.7K]3 years ago
3 0

Answer:

import java.util.*;

public class MyClass {

   public static void main(String args[]) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter your statement: ");

       String inputCharVect = scan.nextLine();

       multiplyString(inputCharVect);        

   }

   

   public static void multiplyString(String input){

       int indexOfWordStart = input.indexOf("t");

       int indexOfWordEnd = input.indexOf("s");

       String firstString = input.substring(0, indexOfWordStart);

       String secondString =input.substring(indexOfWordEnd + 1);

       int firstNumber = Integer.parseInt(firstString.trim());

       int secondNumber = Integer.parseInt(secondString.trim());

       int multResult = firstNumber * secondNumber;

       System.out.println(multResult);

   }

}

Step-by-step explanation:

The first line of the program is the import statement which import Scanner to allow user input. Then, the user input is assigned to inputCharVect, which is then supplied as arguments to the method multiplyString.

The multiplyString method then extracts the index of 't' and 's' which are the start letter for times, then generate a substring, after which it was assigned to firstNumber and secondNumber. The product of firstNumber and secondNumber is assigned to multResult.

You might be interested in
Hey loves, can any of you lovely people help me with this question?
Yuliya22 [10]

Answer:

(c) the supplements of congruent angles are congruent.

Step-by-step explanation:

Since JKL and JLK are respectively the supplements of angles 3 and 4, we can use the justification

(c) the supplements of congruent angles are congruent.

8 0
3 years ago
Read 2 more answers
Please answer this question fast​
svetoff [14.1K]

Answer:

348 of them are not postgraduates

Step-by-step explanation:

4 0
3 years ago
Read 2 more answers
Help please, I attached the question. Is it a!? <br> 
AVprozaik [17]

Answer:

A

Step-by-step explanation:

Recall that for a quadratic equation of the form:

0=ax^2+bx+c

The number of solutions it has can be determined using its discriminant:  

\Delta = b^2-4ac

Where:

  • If the discriminant is positive, we have two real solutions.
  • If the discriminant is negative, we have no real solutions.
  • And if the discriminant is zero, we have exactly one solution.

We have the equation:

2x^2+5x-k=0

Thus, <em>a</em> = 2, <em>b</em> = 5, and <em>c</em> = -<em>k</em>.

In order for the equation to have exactly one distinct solution, the discriminant must equal zero. Hence:

b^2-4ac=0

Substitute:

(5)^2-4(2)(-k)=0

Solve for <em>k</em>. Simplify:

25+8k=0

Solve:

\displaystyle k = -\frac{25}{8}

Thus, our answer is indeed A.

3 0
2 years ago
Read 2 more answers
Use the given information to find the p-value. also use a0.05 significance level and state the conclusion about the null hypothe
omeli [17]

Answer:

(a) C: 0.0465 ; reject the null hypothesis

(b) B: 0.3409 ; fail to reject the null hypothesis

Step-by-step explanation:

Firstly, the decision rule based on P-value to reject the null hypothesis or fail to reject the null hypothesis is given by;

  • If the P-value of test statistics is less than the level of significance, then we have sufficient evidence to reject our null hypothesis.
  • If the P-value of test statistics is more than the level of significance, then we have insufficient evidence to reject our null hypothesis due to which we fail to reject our null hypothesis.

(a) Now, we are given alternate hypothesis, H_1 : p < 3/5

Also, z test statistics is -1.68. Since this is a left tailed test, so P-value is given by;

             P-value = P(Z < -1.68) = 1 - P(Z \leq 1.68)

                           = 1 - 0.95352 = <u>0.0465</u>

Since, the P-value of test statistics is less than the level of significance as 0.0465 < 0.05, so we have sufficient evidence to reject our null hypothesis due to which <u>we reject the null hypothesis.</u>

(b) Now, we are given alternate hypothesis, H_1 : p > 0.383

Also, z test statistics is 0.41. Since this is a right tailed test, so P-value is given by;

             P-value = P(Z > 0.41) = 1 - P(Z \leq 0.41)

                           = 1 - 0.6591 = <u>0.3409</u>

Since, the P-value of test statistics is more than the level of significance as 0.3409 > 0.05, so we have insufficient evidence to reject our null hypothesis due to which <u>we fail to reject the null hypothesis.</u>

5 0
2 years ago
I gots some mathhhhh.<br> if you get all three done first then u get brainliest
Burka [1]

Answer:

will you write them? my school computer blocked the picture

Step-by-step explanation:

5 0
2 years ago
Other questions:
  • How many students were reading during study time?
    10·1 answer
  • How do you solve this problem?
    5·2 answers
  • There are 16 types of flowers used to decorate for a party. Twelve of the flowers types last an average of 4 days before they wi
    7·2 answers
  • A negative rational number that is not a integer? Examples
    13·2 answers
  • Antisocial personality disorder (ASPD) is characterized by deceitfulness, reckless disregard for the well-being of others, a dim
    5·1 answer
  • Which of the following scale factors would produce a contraction under a dilation of the original image?
    5·1 answer
  • a bullet fired from a gun traveled 3,600 m south in 6.0 seconds. What was its velocity in (a) m/sec and (b) km/hour?​
    6·1 answer
  • Help please!!!!!!!!!!
    7·1 answer
  • The following formula gives the temperature's measure in degrees Fahrenheit F, where C is the measure
    5·1 answer
  • Please tell me how to get the answer I will give brainliest
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!