Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that will take in any number of integers from a user and output back to the user the same numbers each sorted

image text in transcribed
Write a program that will take in any number of integers from a user and output back to the user the same numbers each sorted into either an 'prime or an 'non-prime list. Here are the details: - When the program runs a weicome message should be displayed that explains to the user what it is that the program does. - Ask the user to enter any number of integers (a comma-separated list of whole numbers) - For each of the numbers provided into a List (hint: use the string split() method for this part). prime numbers' list (hint: use a loop for this part) Note: A prime number is a number that is divisible only by two numbers itself and one. The factor of a number is a number that can divide it. The list of the first ten prime numbers is 2,3,5,7,11,13,17,23,29,31. A number that is not prime is a composite number. A composite number is a number that can be divided by more than two numbers. Display all odd and all even numbers as two lists of numbers A sample output: prime numbers are 2,3,5,7,11,13,17 non-prime numbers are: 4.6.8,9,12 Hint can use string join() method to join the multiple List items as a comma-separated list of strings, for printing. Or, can use a loop instead, for the same purpose, Either approach is acceptable. - Follow the good coding practices we've discussed. Document the program

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_2

Step: 3

blur-text-image_3

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 2 Lncs 13427

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124251, 978-3031124259

More Books

Students also viewed these Databases questions

Question

8. How would you explain your decisions to the city council?

Answered: 1 week ago