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
____ technology essentially takes the data to be transmitted and rather than transmitting it in a fixed bandwidth spreads it ove
aleksley [76]

Answer: Spread spectrum

Explanation:

In spread spectrum the data to be transmitted is spread over a wider bandwidth rather than fixed bandwidth.

4 0
4 years ago
Computer simulations were first developed during __________<br> as a part of the _____________
Effectus [21]

Answer:

WWII; Manhattan Project.

Explanation:

Computer simulation refers to a mathematical model designed and developed to predict the outcome or behavior of a hypothetical or real-life scenario on a computer system, so as to illustrate and understand how the system functions.

Historically, computer simulations were first developed during World War II (WWII) as a part of the Manhattan Project.

For example, SimpleScalar refers to a computer architectural simulating software application or program which was designed and developed by Todd Austin at the University of Wisconsin, Madison, United States of America. It is an open source simulator written with "C" programming language and it's used typically for modelling virtual computer systems having a central processing unit (CPU), memory system parameters (hierarchy), and cache.

6 0
3 years ago
Declare a prototype for a function called isPrime that returns true or false and expects a single parameter named number of type
Sphinxa [80]

<u>Answer:</u>

<em>A prototype for a function called isPrime that returns is true.</em>

<u>Explanation:</u>

Function prototype is just a skeletal part of the function which has <em>a return type, function name and the respective parameters. </em>

There is a difference between function and function prototype.

Function is nothing but a <em>function definition</em>, where it actually has all the lines of codes which need to be processed when it is called. It can be invoked any number of times and anywhere within the<em> scope of the function</em>. <em> </em>

As per the given question, the prototype can be,

<em>bool isPrime (int); </em>

7 0
3 years ago
When using presentation aids A. make the aid available for the audience to look at throughout the speech. B. prepare to give you
DanielleElmas [232]

Answer: options A and B.

Option A, make the aid available for the audience to look at throughout the speech.

Option B, prepare to give your presentation without the aids, incase problem arises.

Explanation:

Presentation aids, sometimes also called sensory aids, are the resources beyond the speech itself that a speaker uses to enhance the message conveyed to the audience.

The type of presentation aids that speakers mostly make use of are visual aids; pictures, diagrams, charts and graphs, maps... Audible aids (musical excerpt, sound effects) and olfactory aids (fragrance samples or food samples) are also used.

* Presentation aids can be used throughout the speech but it should be used for essential points so as to to tire or bore the audience.

* Ensure presentation still works without the presentation aids in case of technical problems or if any problem arises at all.

* While explaining the aids, focus should be on the audience and not the presentation aids itself.

* Practice should be done with the presentation aids in advance so as to avoid any error while presenting.

Therefore, options A, B should be done when using presentation aids.

6 0
3 years ago
What is faster C++ or go lang
alukav5142 [94]

Answer:

C++

Explanation:

3 0
3 years ago
Other questions:
  • What are the benefits of organizing your thoughts before you begin your speech
    14·1 answer
  • How many packets does your computer send/receive in a single mouse click when you visit a website?
    6·1 answer
  • Which question best addresses the issue of risk with a new job?
    7·2 answers
  • What part of the network is the point where the responsibility of the administrator ends and the telecommunications providers re
    5·1 answer
  • To drive defensively means taking proactive measures to avoid accident situations regardless of their potential causes.
    6·2 answers
  • Which attack intercepts communications between a web browser and the underlying computer?
    10·1 answer
  • A high school in a low-income area offers special programs to help students acquire the technical skills needed to find jobs as
    12·1 answer
  • PLS PAK I ANSWER NITO KAILANGAN LANGPO​
    6·1 answer
  • Class C Airspace inner ring begins at the __________ and extends vertically (by definition) to MSL charted values that generally
    5·1 answer
  • What is string literal in Java?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!