Question: please do this program in Java Write a program (in any language) which reads in numbers from the keyboard, one per line, until it gets
please do this program in Java
Write a program (in any language) which reads in numbers from the keyboard, one per line, until it gets a zero. For each number, print out whether it is prime. After the zero is read, print out (in this order):
- the number of values entered,
- how many were prime,
- how many were not prime (do not count the zero),
- the highest prime number,
- the lowest prime number.
For this program, a prime number is any whole number greater than or equal to 2 that is not divisible by any values other than the number 1 and itself.
Python 3.8.1 Shell Python 3.8.1 (v3.8.1: 16293b6006, Dec 18 2019, 14:08:53) (Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license()" for more information. RESTART: /Users/kilroy/Rowan/Class/LabTech/Primes/primes.py 4231 4231 is prime 9 9 is not prime 17 17 is prime 3 3 is prime 12 12 is not prime 0 # values: 5 Primes: 3 Non-primes: 2 Max prime: 4231 Min prime: 3 >>> Ln: 22 Col: 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
