Write a class called FactorCalculator that contains the following methods: a con

Write a class called FactorCalculator that contains the following methods:
a constructor that accepts a single positive integer, called n
if n is not positive, print an error message
a method called printFactors that prints out all of the distinct factors of n and returns the number of distinct factors (accepting no arguments)
for example, the distinct factors of 16 are 1, 2, 4, 8, and 16 and the number of distinct factors is 5
print the factors in increasing order
a method called isPrime that returns (as a boolean) whether n is prime or not
a method called printPrimeFactors that prints out all of the distinct prime factors of n and returns the number of distinct prime factors (accepting no arguments)
a number is prime if it is divisible only by itself and 1
for example, the only distinct prime factor of 16 is 2
another example: the distinct prime factors of 100 are 2 and 5
print the prime factors in increasing order
*Notes from me*
Project should be done in Java.
Should only take 15-20 minutes for an experienced programmer, this is unit 4 of AP computer science.
Make sure to use simple terminology since this is only a high school course and only covers subjects up to unit 4

Posted in Uncategorized

Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount