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
elena-s [515]
3 years ago
15

Given two Strings String s1 = "11223351638791377189728193"; String s2 = "983763978669976862724569282405742578"; and String varia

ble s3. Write a piece of code so that s3 refers to a String whose integer value will be the product of integer values of s1 and s2. Java.
Computers and Technology
1 answer:
inn [45]3 years ago
7 0

Answer:

import java.math.BigInteger;  

public class Main {  

public static void main(String[] args)  {  

String s1 = "11223351638791377189728193";   String s2 = "983763978669976862724569282405742578";

BigInteger num1 = new BigInteger(s1);  

BigInteger num2 = new BigInteger(s2);  

BigInteger product = num1.multiply(num2);  

String s3 = product.toString(10);

System.out.println(s3);  

}  

}  

Explanation:

Because s1 and s2 contain large integers, the program need the biginteger module in other to compute the products of s1 and s2 when converted to integers.

This line initializes the two string variables s1 and s2

String s1 = "11223351638791377189728193";   String s2 = "983763978669976862724569282405742578";

The next two lines convert the two strings to BigInteger. This allows the program to multiply large integers

<em> BigInteger a = new BigInteger(s1);   </em>

<em>BigInteger b = new BigInteger(s2);  </em>

<em />

This computes the product of the two big integers

BigInteger product = num1.multiply(num2);  

This converts the product to String s3

String s3 = product.toString(10);

This prints s3

System.out.println(s3);  

}  

}  

You might be interested in
With the sheets grouped, apply Underline to cell B5 and Double Underline to cell B6. Ungroup the worksheets. Note, use the Forma
Orlov [11]

Answer:

Check Explanation.

Explanation:

Task: (1). Apply Underline to cell B5 and Double Underline to cell B6.

(2). Ungroup the worksheets.

(3).use the Format Cells dialog box to ensure that the Underline styles Single and Double are applied, rather than Single Accounting or Double Accounting.

Steps to follow;

Step one: On the Excel document that you are working on, make sure you highlight from B6 cell to F6 cell.

Step two: Then, press CTRL+SHIFT+F.

Step three: from action in step two above, the "format cells dailogue box" will come up, click underline > (underline type) dropdown list > ok.

Step four: next, highlight from B7 to F7.

Step five: press CTRL+SHIFT+F. As in step two above.

Step Six: do the same thing as in Step three above.

Please note that to apply the SINGLE UNDERLINE, you need to type the data in the cell for cells of B6 to F6 ONLY.

Also, for DOUBLE UNDERLINE for B7 to F7; just type the data in the cell and it will apply.

4 0
3 years ago
What is the correct sequence of processing instructions in a machine cycle?
Aleks04 [339]

Answer:

The four-step process of fetch, decode, execute, and store. Type of memory where the contents of this are not erased when the computer is turned off.

7 0
3 years ago
Which of the following items are typically included in a balanced budget A. The amount you earn in income
taurus [48]
D is the correct answer

8 0
3 years ago
Computers can accomplish many tasks today, but there are still some things they cannot do. Think of some of the things you would
postnew [5]
Record our dream.
Since it is from the future and advanced, it is invalid to argue back that the wish to record our dreams cannot be fulfilled.

From here you can elaborate more ...
7 0
3 years ago
Which type of document would be best created in Word?
givi [52]

Answer:

it would be Animation I declare

6 0
2 years ago
Other questions:
  • In databases and database-related software, which choice is not a Boolean operator?
    7·2 answers
  • List three types of cardinalities for relationships within a relational database.
    9·1 answer
  • Which Internet resource can you use to publicly describe an adventure trip you recently made?
    9·1 answer
  • Which of the following is not a true statement about Christopher Columbus it oko
    15·1 answer
  • What is seven times seven divided by 49
    14·2 answers
  • How do I center images in HTML. Also I need to have one image lay over another. How do I do this in HTML?
    11·1 answer
  • How many responses does a computer expect to receive when it broadcasts an ARP request?why?
    12·1 answer
  • Which of the following are valid variable names? Select 2 options.
    14·1 answer
  • Business use a fax cover sheet is to
    12·1 answer
  • Review 03 diagnostic and troubleshooting skills including data gathering methods and techniques.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!