Question 1: You'll need three classes: A parent class, a child class, and the driver program. Access the protected int variable in the parent class through a variable of the child class type in your driver program. Make sure the parent and the child classes are in different packages.

If it's possible to do it, then do it, and submit your code. If it's not possible to do it, then explain why/provide links.

Question 2: Let's say that you draw a square around the top right quadrant of a circle. If the circle has a radius r, then the square that covers the top right quadrant of the circle will cover an area r^2. The area of a circle is Pi*r^2. Given that we're dealing with only the top right quadrant, the area will be (Pi*r^2)/4. The ratio of the area of the top right quadrant of the circle to the square that covers it would be...?

Generate 4 billion random dots that fall within that square. Figure out how many of them fall within the circle, and how many fall outside of it. That ratio should be the same as what you computed in the last step. From there, you should be able to figure out what Pi is. Calculate and print this value. Btw, this is known as the monte carlo method.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.