Methods Constructor getClassName returns the class name calculatePrice returns

Methods constructor getclassname returns the class

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

Methods: Constructor. getClassName( ): returns the class name. calculatePrice( ): returns the policy price calculated as follows: cost + 20% if the person age is greater 40. Cost = ($200 for degree 1, $250 for 2, and $300 for 3) 1
Image of page 1
CarInsurance: a concrete class derived from the InsurancePolicy: Attributes ( declared as private) : kind: an integer (1, 2) carNum: a String to store the insured car number. carYear: a number to indicate the car-manufacturing year. Methods: Constructor. getClassName( ): returns the class name. calculatePrice( ): returns the policy price calculated as follows: cost + 15% if the car was manufactured before the year 2000. Cost = ($250 for kind 1 and $300 for kind 2) Write a driver program to create N Insurance policies. The user should input the type of a policy and its corresponding attributes. Problem 2: Write the class definitions and implementations for the following class specifications. Person Attributes fName: a String of characters. lName: a String of characters. nationality: a String of characters. Methods Default constructor Constructor set methods get methods toString: to return information about a person Coordinator (is a Person) Attributes id: a String bS: to store the coordinator basic salary.
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

  • Fall '19
  • Bilal Owaydat

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

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors