Two numbers, num1 and num2, are said to be "friendly" if the sum of proper factors of num1 is equal to num2 and the sum of the proper factors of num2 is equal to numt. The method main below is to print either "Friendly" or "Not Friendly" to indicate whether two integer command line inputs, num1 and num2, are "friendly". Complete main so that is works as intended. You must call method sumOfDivisors in your solution. You may assume that the method sumOfDivisors returns the sum of the proper factors of its integer parameter. public class Friendly { Run | Debug public static void main(String [] args){ // WRITE YOUR CODE HERE } /* This method returns the sum of the proper divisors of n. A proper divisor is a number between 1 and n-1 inclusive that Divides into n evenly. YOU DO. NOT HAVE TO WRITE THIS CODE. Assume this method works as intended. */ public static int sum0fDivisors(int n){

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter21: Simulation
Section21.5: Simulations With Continuous Random Variables
Problem 7P
icon
Related questions
Question
Two numbers, num1 and num2, are said to be "friendly" if the sum of proper factors of num1 is
equal to num2 and the sum of the proper factors of num2 is equal to num1.
The method main below is to print either "Friendly" or "Not Friendly" to indicate whether two
integer command line inputs, numt and num2, are "friendly". Complete main so that is works as
intended. You must call method sumOfDivisors in your solution.
You may assume that the method sumOfDivisors returns the sum of the proper factors of its
integer parameter.
public class Friendly {
Run | Debug
public static void main(String[] args){
// WRITE YOUR CODE HERE
}
/*
This method returns the sum of the proper divisors of n.
A proper divisor is a number between 1 and n-1 inclusive that
Divides into n evenly. YOU DO. NOT HAVE TO WRITE THIS CODE.
Assume this method works as intended.
*/
public static int sumofDivisors (int n){
Transcribed Image Text:Two numbers, num1 and num2, are said to be "friendly" if the sum of proper factors of num1 is equal to num2 and the sum of the proper factors of num2 is equal to num1. The method main below is to print either "Friendly" or "Not Friendly" to indicate whether two integer command line inputs, numt and num2, are "friendly". Complete main so that is works as intended. You must call method sumOfDivisors in your solution. You may assume that the method sumOfDivisors returns the sum of the proper factors of its integer parameter. public class Friendly { Run | Debug public static void main(String[] args){ // WRITE YOUR CODE HERE } /* This method returns the sum of the proper divisors of n. A proper divisor is a number between 1 and n-1 inclusive that Divides into n evenly. YOU DO. NOT HAVE TO WRITE THIS CODE. Assume this method works as intended. */ public static int sumofDivisors (int n){
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole