Question: Write a java program that prompts the user to enter two positive integers that are at least 25 numbers apart. Write the following methods in

 Write a java program that prompts the user to enter two

Write a java program that prompts the user to enter two positive integers that are at least 25 numbers apart. Write the following methods in the Main.java file: A method named validate that takes the two integers as arguments and returns true if the two inputs are at least 25 numbers apart, and false if they are not. If this method returns a false, prompt the user to enter the two values again before proceeding with the program. A method named calcSum that takes the two integers as arguments and returns the sum of all integers between them, inclusive. Use a do while loop in this method. A method named countMultiples Of7 that takes the two integers as arguments and returns the number of multiples of seven between them, inclusive. Use a for loop in this method. A method named countOddNumbers that takes the two integers as arguments and returns the number of odd numbers between them, inclusive. Use a while loop in this method. A method named getLargestEven that takes the two integers as arguments and returns the largest even number between them, inclusive. A method name countPrimes that takes the two integers as arguments and returns the number of prime numbers between them, inclusive

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!