Question: java A special number is a number that is equal to the sum of its prime factors. A prime number can only be divided by

java A special number is a number that is equal to thejava

A special number is a number that is equal to the sum of its prime factors. "A prime number can only be divided by 1 or itself, so it cannot be factored any further! Every other whole number can be broken down into prime number factors. It is like the Prime Numbers are the basic building blocks of all numbers." Math is fun Write a program that takes an input from the user, and after complete error checking, as explained under the program description, calls the appropriate functions to print the prime factors or special numbers. Program Description You have to create the following methods: 1. Write a function ' prime_factors' that takes as parameter ' num', a positive integer, and returns an array containing its prime factors. 2. Write another function named 'special_numbers' that takes as parameter a positive integer 'num' and returns an array of all the specials numbers from 0 to that number inclusive. Use your ' prime_factors' function in this function. 3. main program should input a select integer value followed by number n from the user, and check if the number n is a positive integer or not. If it is zero or a negative number, make it 2 . If all is fine, then it should make the correct function call based on select value (see input format for custom testing below) and print the result array. Constraints

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!