Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

complete in BlueJ please Write a program (in any language) which reads in numbers from the keyboard, one per line, until it gets a zero.

complete in BlueJ please
image text in transcribed
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): 1. the number of values entered, 2. how many were prime, 3. how many were not prime (do not count the zero). 4. the highest prime number, 5. the lowest prime number. For this program, a prime number is any whole number greater than or equal to 2 that its s not divisible by any values other than the number 1 and itself. Flere is sample output from one version of the program, done in Python using IDLE: 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 # values: 5 Primes: 3 Non-primes: 2 Max prime: 4231 Min prime: 3 >>>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions

Question

What are Electrophoresis?

Answered: 1 week ago