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
PLEASE HELP I NEED HELP WITH THIS ASAP. PLEASE show work, thank you. Will give branliest
d1i1m1o1n [39]
If the slope is 5 perpendicular would be -1/5 just flip the slope around
3 0
3 years ago
How many times can 12 go into 307
FinnZ [79.3K]
12 can only go into 30 about 25 whole times.
5 0
3 years ago
Mr. Itol's assistant takes twice as long to complete a computer task as Mr. Itol. If it takes both experts 6 hours to complete t
Lesechka [4]
So, in order to solve this problem, I will set up an equation. First, let's make x= the # of hours it takes Mr. Itol to complete a computer task, and since his assistant takes twice as long, lets make 2x=the # of hours it takes the assistant to complete the task. We also know that it takes the two of them 6 hours to complete the task together. We can now set up the following equation: 

\frac{1}{2x} +  \frac{1}{x} =  \frac{1}{6}

Now, in order to be able to solve this, we have to find the least common denominator, and then we can cancel out the denominators to solve for the top part. The LCD=6x and the new equation becomes: 

\frac{3}{6x} +  \frac{6}{6x} =  \frac{x}{6x}

Now, we can get rid of the denominators, and we get:

3+6=x

So, x= 9

Now we know that Mr. Itol would take 9 hours to complete the task if he were to do it himself. To find how long it would take his assistant to complete the same task by himself, we just need to plug in the x-value into 2x:

2(9)=18

Therefore, your answer is that Mr. Itol would take 9 hours to do the job alone, while his assistant will take 18 hours (double the time) to do the job alone.

Hope this helps :) 










4 0
3 years ago
Can you answer this pls ​
Gnoma [55]

just download MATH PAPA app, it will help you solve any hard mathematical problems, I see that your answers are there.

7 0
3 years ago
Drag the tiles to the boxes to form correct pairs. Not all tiles will be used. Match each sine or cosine value to its equivalent
vazorg [7]

Answer:

Step-by-step explanation:

cos(34) =sin(56)

cos(77)=sin(13)

sin(25)=cos(65)

sin(61)=cos(29)

7 0
2 years ago
Other questions:
  • Write an equation for y is one-eleventh of x
    6·1 answer
  • PLEASE HELP!!!!!!!
    14·1 answer
  • HELP URGENT BRAINLY + 5 STAR RATING
    11·2 answers
  • A simple random sample of 72 face-to-face meetings held in March 2020 was selected, and the mean length of this sample of 72 mee
    10·1 answer
  • An angle measures 3.8° more than the measure of its complementary angle. What is the measure of each angle?
    15·1 answer
  • 3 coins Priya spends $45 on gas, $10 on dinner, and $8 on a video game. How much money did Priya spend on variable expenses?​
    9·1 answer
  • Ted likes to run long distances. He can run 20 \text{ km}20 km20, start text, space, k, m, end text in 959595 minutes. He wants
    15·1 answer
  • You have discovered another alien. Find the correct rescue path before answering this question. Which statements are true about
    5·2 answers
  • Your mother drives 60 minutes at a constant speed of 40 miles per hour. She then speeds up, and drives for another 30 minutes at
    13·1 answer
  • A candy factory produces 7 candies a day. How many candies will the factory produce in 100 days ​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!