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
the question is "how many total gallons of each color of paint were left after both girls had finished the project?", do i add o
bearhunter [10]
What is there whole question the I will be able to tell you
5 0
3 years ago
Read 2 more answers
Hm
melomori [17]

Answer:

108m

Step-by-step explanation:

Hello, to find the height of the bigger triangle, you take the width of the bigger triangle and divide by the width of the smaller triangle like this:

72/0.8=90

Then, you take 90 and you multiply it by the height of the smaller triangle like this:

1.2 x 90= 108

So the height of the bigger triangle is 108m.

6 0
3 years ago
Read 2 more answers
1. Ana was washing dishes at the end of her shift at a restaurant. She washed 30 plates from 7:30 to 7:35. When she finishes was
frutty [35]
She washed 30 plates from 7:30 to 7:35.....so she washed 30 plates in 5 minutes.....30/5 = 6 plates per minute

so if she started washing plates at 7:15 and ended at 7:38...how many plates did she wash....
from 7:15 to 7:38 is 23 minutes...and if she can wash 6 plates per minute, then in 23 minutes, she can wash (23 * 6) = 138 plates <==

the equation...
y = -6x + b...with b being the number of plates she started with and x being the number of minutes and y being the plates she has left to wash...I am not 100% sure on this equation...I am so sorry


4 0
3 years ago
Indicate whether each equation is equivalent to this equation: 4x + 3 = 5/2x - 7
9966 [12]

Answer:y = 3 suh slid este ob cine este a, b și g au nevoie de acel kinfo pentru a termina

Step-by-step explanation:

8 0
2 years ago
If h(x)=x-7 and g(x)=x ^2, which expression is equivalent to (g•h)(5)
pashok25 [27]

x^3 ‐ 7x^2

Explanation:

x^2(x-7) = x^3 ‐ 7x^2

7 0
2 years ago
Other questions:
  • What is the sum (2/5 x +5/8)+(1/5 x - 1/4)?
    5·1 answer
  • ❌❌EVALUATE SQUARE ROOTS❌❌
    10·1 answer
  • For a function f(x), a) if f(7) = 22 then f^-1(22) = b) f^-1(f(c)) =
    13·2 answers
  • 8/2(2+2) please help
    14·2 answers
  • Find the distance between the points (-4, 6) and (-1,5).
    8·1 answer
  • What is the maximum of 18.7
    12·1 answer
  • Can anyone help me with this one
    10·2 answers
  • 8th grade math surface area
    14·1 answer
  • The manufacturer that Russell works for makes
    15·1 answer
  • 7.4: How do You Know?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!