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
Help me pls it is geometry
Gekata [30.6K]

Answer:

m < b = 76

Step-by-step explanation:

Because b is directly across from the 76 degree angle, that makes them vertical angles, which means they are the same degree I believe.

5 0
2 years ago
Read 2 more answers
Solve for x 8-2x = 5( x4) ​
MissTica
4/11 because when you multiply 5x4x you get 20x , so 8-2x=20x. Then you move the terms with variables and get -2x-20x=-8. This gives you the answer that -22x=8 and when u divide by 22 to both sides, you get 4/11.
5 0
3 years ago
Slide the green dot Use the number line to plot the numbers. Then arrange
lbvjy [14]

I don't see any green dot, sorry.

6 0
2 years ago
Traveling at a average speed of 50 miles per hour the trip from point a to be is 2 hours traveling at a speed of 20 miles per ho
dem82 [27]
What's your question..?
7 0
3 years ago
Solve the equation by completing the square. Round to the nearest tenth, if necessary. Simplify your solutions and enter them fr
Slav-nsk [51]

Answer:

-1.1, 6.1

Step-by-step explanation:

-2X^2+10X+14=0

(-2X^2+10X+14)/-2=0

X^2-5X-7=0

Then use the quadratic formula because you can't factor

Fill in the equations and solve. One should have the plus and the other should have the minus and that's how you get the 2 different answers.

A=1

B=-5

C=-7

4 0
1 year ago
Other questions:
  • 10 to the power of 16 times 10 to the power of -3
    15·1 answer
  • Which one of these tables best describes a function of exponential decay
    14·1 answer
  • 3x+4y=12 and 2x-y=8. Which ordered pair is a solution to the system of equations?
    10·1 answer
  • According to an​ almanac, 70​% of adult smokers started smoking before turning 18 years old. ​(a) if 200 adult smokers are rando
    15·1 answer
  • A restaurant sees about 600 orders on Tuesday. This is down from last Tuesday by about 0.85%. How many did they see last Tuesday
    15·1 answer
  • You can spend $30 on a shopping trip. You want to buy a shirt that cost $14. Write and solve an inequality that represents the a
    11·1 answer
  • PLEASEEE HELPPP its due in 10 mins PLSSS
    6·1 answer
  • What’s the answer ? Help ASAP
    14·1 answer
  • Please help asap&lt;3(grade 8 question)
    5·1 answer
  • Help me find the area here! 6th grade math
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!