📜 Please help us complete a 5 minute survey!
Published on February 19, 2022
Note: currently you cannot close a screen in the companion, you will have to build the app to test it out.
Screen1
Screen2
I found this image from Wikipedia. Thank you Brosen and Taifun!
Before we begin, you need to know the following.
2024 is a leap year because 2024 is divisible by 4.
2022 is not a leap year because 2022 is not divisible by 4.
1900 is NOT a leap year because although it is divisible by 4, for years that end with 00, they must be divisible by 400 at the same time.
2000 is a leap year because 2000 is divisible by 400.
Method #1 - Using the Clock component to determine date before March 1.
Logic: for exmple, the month is 6 and the year is 2022. We will attempt to get the date before July 2022, which is June 31, 2022. However, it returns an instant, so we get the day number from the instant. December is special because the next month is in a different year, so we just provide 31.
Suppose side AB is side a, side AC is side b and side BC is side c.
The pythagoras theorem states that:
a² + b² = c²
So deeper evaluating it, to get only c, you will have to apply square root to both sides of the equation.
c = √(a² + b²)
Applying this with App Inventor blocks, you only need
However, if you want to get side a, you need a different approach. Remember this equation?
a² + b² = c²
From the relationships between addition and subtraction, you can get:
c² - b² = a²
To get only a, you will have to apply square roots to both sides.
√(c² - b²) = a
Summing it up, you can see this.
Easy enough to calculate side B.
Thanks for METRIC RAT AI2 for providing part of their work.
© Gordon Lu 📧 E-mail 💬 Message 📞 Phone call