ScratchData LogoScratchData
Back to cs1970090's profile

Advanced Math Functions

CScs1970090•Created September 11, 2020
Advanced Math Functions
12
7
181 views
View on Scratch

Instructions

Navigating the start menu: use the arrow keys to go to a button, and then press the space button to select it. At least one of the shown buttons will have the selecting ring around it. The Imperial - Metric Function now works - but the result will be an approximate value. Same with the temperature conversion function. From there, the instructions are in the calculator. If you want to know how the calculator works, read on. The 'Average' function uses a list to support potentially infinite amounts of numbers, then adds all the numbers in that list up, then divides them by the former length of the list. That leads us to the average. The 'Median' function, just like the 'average' function, uses a list. It finds the middle of the list, then figures out if there are an even or odd number of numbers in the inputted data set. If there is an even number, it calculates the average between those two numbers. That brings us to the median. The 'Square Roots' wasn't that hard. Just use the "sqrt" block in the program. Primes - starting at one, checks if a number is prime, then moves on to the next. It then checks the number that you said would be the last one, then says all the prime numbers. The Fahrenheit to Celsius converter and Celsius to Fahrenheit converters use the standard formulas. You can look them up on google. Now here is where things get complicated - measurement conversion. With so many different units to convert between imperial and metric, putting in all of those formulas would be extremely impractical, boring, and no fun at all. So I came up with a solution. So I put in the conversion algorithm to convert between centimeters and inches. Depending on what system you wanted to convert to, and your unit, your inputted number will be converted into centimeters or inches. Then, the computer converts to the other unit. Afterwards, depending on your unit, it will convert to that unit. Say that we want to convert between meters and feet, and we are converting from metric to imperial. Say that you have decided the amount of yards is 20. The system will convert 20 meters into 2000 centimeters. Then, it will convert 2000 centimeters into approximately 787.4016 inches. After, it converts those 787.4016 inches into 65.6168 feet. It says that 20 meters is approximately equal to 65.6168 feet. Note that this value will be pretty close to the actual amount, but may not be the exact answer due to Scratch's calculating errors, especially with numbers with massive amounts of digits. GCF: This uses a prime factoring algorithm at the start to cut down the amount of numbers that it stores (and also because at first it used this algorithm, but decided with Euclid's Algorithm and I was too lazy to take out the algorithm), and then uses Euclid's Algorithm to finish. LCM: Uses an algorithm resembling a division table. Note with GCF and LCM that they were newly imported into the project from my GCF and LCM calculator which was separate. The link is in the description. Are you still with me? If so, feel free to type "INTERESTED" in the chat, heart and favorite the project, check out my other projects, put hearts and favorites on those projects, and follow.

Description

Just to clarify - this is a collection of calculators, not a bunch of quiz questions. Here is the link to my GCM and LCM calculator https://scratch.mit.edu/projects/434174460/ (Note: LCM does not work yet on it) Thanks to HarryB178 for the sorting function. It was needed to find the median, and for other things as well. This project was very reliant on the sorting function. There are bugs galore, tell me if there are any, just in case I haven't found them yet (though I am trying to fix some right now) The amount of blocks in this project is massive (Over 3,000 blocks in the project, and more coming). I think that this project runs several forever loops at once, so that may be a problem. Please love or favorite if you liked the project. I spent loads of time on this, and I will likely be spending even more.

Project Details

Project ID424818438
CreatedSeptember 11, 2020
Last ModifiedNovember 9, 2022
SharedSeptember 15, 2020
Visibilityvisible
CommentsAllowed