lab 6.pdf - 1|Page OBJECT ORIENTED PROGRAMMING LAB 6 TITLE:...

This preview shows page 1 - 12 out of 27 pages.

1 |P a g e
2 |P a g eOBJECT ORIENTED PROGRAMMING LAB 6TITLE:Understanding the Concept of Type Conversion and InheritanceOBJECTIVES:To get familiar with concepts of:Type Conversion.Inheritance.This Pointer.1.Write a program that can convert the Distance (meter, centimeter) to meters measurement infloat and vice versa. Make a class distance with two data members, meter and centimeter.You can add function members as per your requirement.Program:
3 |P a g e
4 |P a g eIDE:
5 |P a g e
6 |P a g e2.Write two classes to store distances in meter-centimeter and feet-inch systems respectively.Write conversions functions so that the program can convert objects of both types.
7 |P a g e
8 |P a g e
9 |P a g e
10 |P a g eIDE:
11 |P a g e3.Create a class called Musicians to contain three methods string(), wind(), and perc(). Each of thesemethods should initialize a string array to contain the following instruments- veena, guitar, sitar, sarod and mandolin under string()- flute, clarinet saxophone, nadhaswaram, and piccolo under wind()

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 27 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
NoProfessor

Newly Uploaded Documents

Show More

Newly Uploaded Documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture