Lab Exercise_60dda13b0e59811c956f7e166f976301.pdf - LAB...

This preview shows page 1 - 3 out of 7 pages.

LAB TEST SET A Name : Matric No: S/G : Email address: Question 1 (10 Marks) Write a java application named CircleCalculator.java. There are one constructor and three methods need to be write in the application. You are required to apply class field and methods in class Math under package java.lang. Mark will be deducted if you are not applied the Math’s class field and methods. Test your CircleCalculator.java with CircleMainApp.java. The expected output as shown below. (10 Marks) Diameter of Circle: [ 2r ] Area of Circle: [ πr² ] Circumference of Circle: [ 2πr ] Area of Sector: ½ × θ × r2 (when θ is in radians) public class CircleMainApp { public static void main(String[] args) { CircleCalculator circle = new CircleCalculator(2); System. out .println( "Diameter : " +circle.calcDiameterOfCircle()); System. out .println( "Area :" +circle.calcAreaOfCircle()); System. out .println( "Circumference :" +circle.calcCircumferenceOfCircle()); System. out .println( "Area of Sector" +circle.calcAreaOfSector(30)); } } Expected Result is: Diameter : 4.0 Area :12.566370614359172 Circumference :12.566370614359172 Area of Sector1.0471975511965976
Image of page 1

Subscribe to view the full document.

Question 2 (10 Marks) Write java implementation of the classes below. Then, write and run the MyFaceBookMain.java.
Image of page 2
Image of page 3
  • Summer '16
  • Mashanum
  • Ali, Malacca, Multimedia University, Syarikat Buku Sdn Bhd, Syarikat Computer Sdn Bhd

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern