Question: Write a java program that contains 2 classes as follow: 1 - Niven class: it contains a method called IsNiven which returns true if the
Write a java program that contains classes as follow:
Niven class: it contains a method called IsNiven which returns true if the passed integer is Niven number, or false if the passed integer is not a Niven number.
NivenFile class: it reads numbers from a file named numbersdat and check whether the number is Niven or not by calling IsNiven method, if the number is Niven store it in a file named nivendat else store it in a file named nonnivendat
Note: A Niven number is any whole number that is divisible by the sum of its digits. For example, is a Niven number because the sum of its digits is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
