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
What is true about the diagram? Select two options <br> A. m B. m C. m D. m E. m
marissa [1.9K]

I’m sorry, but I believe that you have forgotten to attach the image. It would be impossible to solve without it. Please feel free to message me if you need help with this problem once the image it attached. Sorry for the inconvenience.
4 0
3 years ago
Find the formula for the geometric sequence 4, 20, 100, 500, ...
suter [353]

Answer:

2500

Step-by-step explanation:

it is a geometric progression

r=5

3 0
3 years ago
PLEAAASE HELPP that would be very much appreciated
DIA [1.3K]

Answer:

h(x) = (x + 4)^2 - 2

Step-by-step explanation:

Start with the red graph:  f(x) = x^2

First we move the entire graph 4 units to the left.  The resultant function is g(x) = (x + 4)^2.

Next, we move this latest graph 2 units down.  The resultant function (and answer to this question) is h(x) = (x + 4)^2 - 2

8 0
4 years ago
Find the surface area of the right square pyramid. Round your answer to the nearest hundredth.
vlada-n [284]
A= a^2+2a\square root{\frac{a^2}{4}}+h^2
a=base=8
h=height=7
A=surface area
A=177
5 0
3 years ago
Read 2 more answers
Help me plz I'm doing a test and I need help lol
My name is Ann [436]

Answer:

BC = BA

Step-by-step explanation:

6 0
3 years ago
Other questions:
  • In a right triangle, the side opposite a 33 degree angle is 17 units. What is the length of the side adjacent to that angle to t
    8·1 answer
  • What is the second step in sketching the graph of a rational function?
    13·1 answer
  • At the movie theatre, child admission is $5.10 and adult admission is $9.00 . On Monday, 163 tickets were sold for a total sales
    15·1 answer
  • 8. What is the point-slope form of a line passing through the point (-2.5) with the same slope as
    9·1 answer
  • Let ​ f(x)=x^2+6x+11 ​. What is the minimum value of the function? Enter your answer in the box. ​
    6·1 answer
  • Find the volume of rectangular prism of 2,3,6
    6·2 answers
  • At a hardware store, the probability that a customer buys nails is 0.10. The
    9·2 answers
  • Please help with this math problem if You don’t give me a file link I will mark you brainlist!!
    14·2 answers
  • 5/8+1/12 in the lowest terms
    11·1 answer
  • grath has a summer job and earns 9. 32 per hour. one week, he works 16 3/4 hours. He deposits 150$ in a bank and decides to use
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!