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
To speed up data retrieval, more vehicles will be upgraded to cellular connections and be able to transmit data to the ETL proce
stealth61 [152]

To improve the reliability of the solution and minimize data transfer time on the cellular connections we should Directly switch the documents to a one-of-a-kind Cloud Multi-Regional Storage bucket.

<h3>Wat is Multi-Regional Storage?</h3>

Multi-Regional Storage is geo-redundant, this means that Cloud Storage shops your information redundantly in as a minimum geographic locations separated via way of means of as a minimum one hundred miles in the multi-local vicinity of the bucket.

Multi-Regional Storage is suitable for storing information this is often accessed ("hot" objects), along with serving internet site content, interactive workloads, or information helping cell and gaming applications. Multi-Regional Storage information has the maximum availability as compared to different garage classes.

Read more pout the cellular :

brainly.com/question/917245

#SPJ1

8 0
2 years ago
What are the coordinates of (3 comma space 8 )relative to the basis open curly brackets space (1 comma space 1 )comma space (0 c
Snowcat [4.5K]

Answer:

(3,5)

Explanation:

Given the basis β={(1,1),(0,1)} and x=(3,8), I am to find the corresponding coordinate vector [x]β. I claim that the coordinate vectors entries x_{1} and x_{2} meet the following criterion:

x_{1} (1,1) +x_{2} (0,1)=(3,8)

Placing this in matrix form

\left(\begin{array}{cc}1 & 0\\ 1 & 1 \end{array} \right)\left(\begin{array}{c}x_{1} \\ x_{2}\end{array} \right)

x_{1} +0x_{2} =3

x_{1} =3

Also,

1x_{1} +1x_{2} =8

3 + 1x_{2} =8

x_{2} =8-3=5

The coordinate matrix therefore is given as (3,5)

5 0
3 years ago
java Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins w
vfiekz [6]

Answer:

The following are the program in the Java Programming Language.

//set a package

import java.util.Scanner;

//define class

public class Main  

{

 //define a main method

 public static void main(String[] args)  

 {

   //declare the Scanner class object

   Scanner s = new Scanner(System.in);

   //get the size of the array from the user

   int size=s.nextInt();

   //declare an integer array with given size

   int a[]=new int[size];

   //declare a string array with given size

   String word[]=new String[size];

   //set the for loop  

   for(int i=0;i<size;i++)

   //get string input from the user

   word[i]=s.next();

   //iterates with the array, increase the count

   for(int i=0;i<size;i++)  

   {

     for(int j=0;j<size;j++)  

     {

       //check that elements of words

       if(word[i].equals(word[j]))

         //increament in the array by 1

         a[i]++;

     }

   }

   System.out.print("\n");

   //set for loop to print the following result

   for(int i=0;i<size;i++)

     System.out.println(word[i]+" "+a[i]);

  }

}

Explanation:

<u>The following are the description of the program</u>.

  • Firstly, set the required predefined package and define class 'main then, define main method inside the class and inside the method.
  • Declare the object of the scanner class and get the size of the array through the object in the variable 'size'.
  • Then, declare two array which are integer type 'a' with the given input size and string type 'word' with the given input size.
  • Set the for loop that get string type array elements from the user and again set two for loop that increase the size of the integer data type array by 1 with the loop iteration.
  • Finally, set the for loop that print the following result.
6 0
3 years ago
In which career field would the computing technology industry associations compTIA A+ certification be useful
loris [4]
Technology would be the best
5 0
3 years ago
Which programming element is used by a game program to track and display score information?
lubasha [3.4K]
I think is Variablesss
7 0
3 years ago
Read 2 more answers
Other questions:
  • HELP NOW PLZZ/ Question: Complete the sentence with the correct response.
    11·1 answer
  • Which of the following is a true statement? Question 33 options: Data entities correspond to sources/sinks on a data flow diagra
    14·1 answer
  • Discuss advantages and disadvantages of Twisted Pair?
    6·1 answer
  • Write a method called printRange that accepts two integers as arguments and prints the sequence of numbers between the two argum
    6·1 answer
  • More recent GPU families such as Fermi and Kepler have adopted CPU-style virtual memory architecture with a____________-bit virt
    8·1 answer
  • Define a function below, sum_numeric_vals, which takes a single dictionary as a parameter. The dictionary has only strings for k
    12·1 answer
  • why is the disk method a special case of the general slicing​ method? choose the correct answer below. a. the cross sections of
    7·1 answer
  • What devices gives input​
    5·1 answer
  • All computer systems have
    14·2 answers
  • What output is generated by this for loop?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!