Answered step by step
Verified Expert Solution
Question
1 Approved Answer
undefined 1. The purpose of this homework: is to refresh your java skill with a topic, big number, which will be used in the future.
undefined
1. The purpose of this homework: is to refresh your java skill with a topic, big number, which will be used in the future. As we discussed in the class, all of the current encryption techniques rely on big number, since small number is easy to break. In this homework, you will learn how to use the package "java.math.BigInterger. Desired output: Your output should print correct results for 2! through 50! The codes that calculates factorials of 2 to 40 are provided. Your job is to follow the same logic and calculate factorials up to 50 by using java.math.BigInteger. Hint: (1) check java document about BigInteger first to learn the constructor(s) and methods it provides; (2) try some examples that provided by the document; (3) do the homework. import java.math.BigInteger; public class Factorial { public static void main(String args[]) { // Calculate factorials with an int // When i goes past 13, problems arise, do you see? int factorial = 1; for (int i = 2; iStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started