ScratchData LogoScratchData
Back to cwrivera99's profile

Prime/Composite Number Sorter

CWcwrivera99•Created October 29, 2014
Prime/Composite Number Sorter
0
0
81 views
View on Scratch

Instructions

Click the green flag to begin computing. Click the pause button to pause the sorter. Click the resume button to continue. Click the restart button to start over.

Description

DO NOT ADD THIS PROJECT TO ANY AE STUDIOS! This is a very simple project that took me less than 5 minutes to make. The actual sorting part probably took about 1 minute. To determine if a number is prime or composite, the sorter takes that number, then divides this number by every number smaller than it. Then it tests the quotient to see if it has a remainder. If the quotient does not have a remainder, (meaning the dividend is evenly divisible by the divisor,) then it is added to the list of composite numbers. If the sorter goes through the entire list and the number is not divisible by anything other than 1 or itself, then it is added to the list of prime numbers. You will notice that the amount of prime numbers found decreases as the sorter reaches higher numbers. This is because the farther up you go on the number latter, the less prime numbers you will find. You will also notice that neither 1 or 0 is not included on either list. That is because they are not classified as either prime or composite.

Project Details

Project ID31838830
CreatedOctober 29, 2014
Last ModifiedNovember 25, 2014
SharedOctober 30, 2014
Visibilityvisible
CommentsAllowed