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
A device receives a data link frame with data and processes and removes the Ethernet information. What information would be the
il63 [147K]

The information that would be the next to be processed by the receiving device is: IP at the internet layer.

<h3>Internet protocol (IP)</h3>

Internet protocol is a network protocol that help to transmit data to user device across the internet or network which inturn make it possible for user device to connect and communicate over the network.

Internet protocol at the internet layer is a TCP/IP software protocol which sole purpose is to transfer data packets across the internet after receiving and processing the data.

Inconclusion the information that would be the next to be processed by the receiving device is: IP at the internet layer.

Learn more about internet protocol here:brainly.com/question/17820678

7 0
2 years ago
Scenario2: Now suppose the LAN must support both voice and data and you must choose one of these multiple access strategies in o
AleksandrR [38]

Answer:

The RTP (real time protocol) which uses the UDP ( user datagram protocol) and Real-time control protocol.

Explanation:

The RTP of a voice over IP protocol (VoIP) which is used to prioritise the transfer of video and audio data over text data. It is used for video conferencing and telephony services in an enterprise.

It uses the user-datagram protocol to transfer or access videos and audio data for its real time effect and the real-time control protocol for quality of service analysis and maintenance.

4 0
3 years ago
Is anyone familiar in drawing flow charts for c++ programming
Elina [12.6K]
Yes, but I use Unreal Engine

3 0
3 years ago
How to type the horizontal line on Mac ? Please I need to finish my assignment
leonid [27]
.
Open your text editor, such as TextEdit, or word processor, such as Pages or Microsoft Word.

2.
Open a document and click your cursor in front of whitespace where you can enter a character.

3.
Press the key combination "Shift-\" to type the "|" symbol.

8 0
3 years ago
Task 3&amp;4, please <br> with the formula
Anastasy [175]
It’s 12 because 3 times 4 is twelve, hope i helped!
6 0
3 years ago
Other questions:
  • Ann. An employee in the payroll department, has contacted the help desk citing multiple issues with her device, including: Slow
    7·1 answer
  • Which of the following should businesses and organizations do to promote a safe work environment?
    6·1 answer
  • As a digital forensics examiner, it’s a good idea to build a list of references for information on privacy laws in other countri
    13·1 answer
  • The Hazard Communication Standard, commonly called the “Right-to-Know” law, gives you the right to know what information?
    6·2 answers
  • Choose the list of the best uses for word processing software.
    5·1 answer
  • Search the web to discover the 10 most common user-selected passwords, and store them in an array. Design a program that prompts
    7·1 answer
  • Write a loop that sets each array element to the sum of itself and the next element, except for the last element which stays the
    15·1 answer
  • Which best describes the Help feature of Word?
    13·2 answers
  • So whenever I play among us, I always get killed. Like always. I want to know some Technics to being a crew mate and an impostor
    9·1 answer
  • Does the colour intesity change of the liquid if you add more baking soda?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!