Question: Solve 1 and 2. In Java Exirces#1: Salma learned recently about prime numbers. She can determine whether a number is prime or not for small
Exirces\#1: Salma learned recently about prime numbers. She can determine whether a number is prime or not for small numbers, however, for large numbers she needs to make some calculations. Salma asks you to write a java program to verify if a given number is "Prime" or "not Prime". Remember that she may use your program for very large numbers. Hint: the simplest way to determine if a number (N) is prime or not is to check if the numbers from 2 to N1 divide N without a remainder. (Moreover, stop at N/2 rather than N1 is enough). Exirces\#2: Define a method called sumOfSquares to calculate and return the sum of squares from 1 to n according to the following formula for given n : i=0ni2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
