write 2 java programs classes

need help with discussion questions for each class
October 6, 2021
biology assig 3
October 6, 2021

write 2 java programs classes

Question 1:

Write a program to approximate the area under an ellipse centered at origin. Assume major axis and minor axis lengths are 2a and 2b respectively. Note that you should forget the existence of the well known formula area = πab. 1 Method: The equation of such an ellipse centered at origin is as follows. x 2 a 2 + y 2 b 2 = 1 Divide the area under the first quadrant in to small rectangles of your choice – smaller the better and you should pass this as a parameter to your method (or you can pass number of rectangles, and then calculate the width of the rectangle inside the method), in addition to a and b– and add these areas of all these rectangles to approximate the area of one quarter of the ellipse. Multiplying that value by four give the approximate area of the ellipse. You must test your results with known a and b values (especially, test with a = 1 and b = 1 and you should see π as the area)


Question 2:

Write a method with the name reverse, that reverses a non negative integer passed to it. As an example, it should returns 456 when you pass 654 as the input. Write a test method to test your reverse method (you can use it to test your method in main but comment out before you do the rest of the question). Now, write another method with the name palindrome which takes a non negative integer and check if it is a palindrome. Hint: You should use the reverse method you just created. Make sure to give few test cases for palindrome method in the main method.

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.