Question: Write a programPrimeFactorization.javathat determines the prime factorization of a positive integer n. The program should process a given integer n only if n > 1.
Write a programPrimeFactorization.javathat determines the prime factorization of a positive integer n. The program should process a given integer n only if n > 1.
Program Input:
Your program should read integers stored in a text file(numbers.txt)and find the prime factorizations of valid integers only. That is, your program should process a giveninteger n only if n > 1. You may assume that each line in the text file contains only one integer like:
1
2
49
11
Your program should display the prime factors of valid integers in ascending order. The program should display a message if the input integer is invalid. If the input integer n is prime, the output is 1 n.
Output example:
Invalid Input!
2=1*2
49 = 7 * 7
11 = 1 * 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
