Write a program in javanbspnamed primefactorization that


Write a program in java named PrimeFactorization that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. Integers are accepted and multiplied until the user enters an integer less than 1. This final number is not part of the product. Then, the program prints the product. If the first entered number is negative or 0, the program must print "Bad input." and terminate immediately. Next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. If a prime number is not a factor of the product, then it must not appear in the factorization. Sample runs are given below. Note that if the power of a prime is 1, then that 1 must appear in the answer. Note: Your program's prompt and output messages must conform to the following spelling and spacing

Enter integers: 882 18 26 -45

Product: 412776

Prime factorization: 2ˆ3 3ˆ4 7ˆ2 13ˆ1

Solution Preview :

Prepared by a verified Expert
Business Management: Write a program in javanbspnamed primefactorization that
Reference No:- TGS01644289

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)