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
unlike the barcode-based tracking system, a radio frequency identification system offers a .
Over [174]

Unlike the barcode-based tracking system, a radio frequency identification system offers a <u>no-contact, no-line-of-sight reading, and tracking system</u>.

What is a tracking system?

A tracking system often referred to as <u>a locating system, is used to keep </u><u>track </u><u>of people or objects in motion and provide an accurate, timely sequence of location data for processing</u>. Human tracking should be understood; more information is provided below.

<u>Any stolen car can be kept </u><u>track </u><u>of across the nation</u> with the use of a tracking system, ensuring that it is returned as soon as possible. A tracking system is a crucial tool for making sure your personnel is safe.

To learn more about tracking system, use the link given
brainly.com/question/15237193
#SPJ4

8 0
1 year ago
On the Format tab, in the Shape Styles group, there is the option to change the _____. a. Shape Effects b. Shape Fill c. Shape O
makvit [3.9K]
Hey there! Hello!

The answer to this problem will be D, "All Of The Above." I've attached a picture that shows the Shape Format tab in Microsoft Word. You can see in the dropdown that there's options for all three of your listed choices: Shape Fill, Shape Outline, and Shape Effects. 

I hope this helped you out! Feel free to ask me any additional questions if you have any. :-)

6 0
3 years ago
Which access object cannot be used to enter or edit data
kap26 [50]

Answer:

Should be B. table !

6 0
2 years ago
Read 2 more answers
There is a flashing yellow light at the intersection you are approaching. What does the flashing yellow light indicate, and what
Ilia_Sergeevich [38]
The flashing yellow light indicates that people should be aware of other cars and turn carefully. To be more safe, you should slightly slow down, make sure all signals that should be on are on, and you should drive very carefully.
6 0
3 years ago
A web page typically contains ________, which contains the formatting instructions for displaying the web page.
USPshnik [31]
HTML: Hypertext Markup Language. It's used in conjunction with CSS (Cascading Style Sheets), which implements presentation (adding color, positioning elements, etc.) and JavaScript (you'll often see this referred to as JS), which implements functionality (like clicking on buttons) for webpages.
3 0
3 years ago
Other questions:
  • For some brand-name computers, the hard drive contains a partition that can be used to reinstall windows. what is the name for t
    6·1 answer
  • Press the ____ key(s) to erase one character to the left of the insertion point.
    10·2 answers
  • There are two activities on your schedule, which are: 1) install server in lab 2) move server into the data center. however, the
    6·1 answer
  • Which type of communication is usually handwriten
    11·2 answers
  • You can use Facebook's Live Feed tool to broadcast content as you post it, true or false?
    11·1 answer
  • A computer has 9850 processes and 172 of them where suspended while 276 were terminated.,explain why some of the processes where
    15·1 answer
  • What food does swiss eat on christmas?
    10·1 answer
  • Write bash script which takes array as an input of size 10 bind its even indexes to accept even values and odd indexes to accept
    5·1 answer
  • If the old and new systems are operated side by side until the new system has proven itself, this type of system conversion plan
    11·1 answer
  • I need to reverse a inputted word using for loops with range 0 to the input word and increment 1.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!