Computer Science, asked by sreetama1d, 10 months ago

O. WAP in Java that defines class Table whose description is given below:
Data Members (Instance variables): length, breadth and height in metres.
Member Methods:
() To accept the values
(ii) To display the values
(iii) Convert metres to centimetres.
Define main method to call the above methods.​

Answers

Answered by akshayamca14
0

Answer:

public class Table

{    

   private float metervalue;

   private float centemetervalue;

   

   public void Setvalue(float meter){

       metervalue=meter;

   }

   public void CalculateinMeter(){

       centemetervalue=metervalue*100;

   }

   public void Display(){

       System.out.println(centemetervalue);

   }

}

public class Table

{

   

   private float metervalue;

   private float centemetervalue;

   

   public void Setvalue(float meter){

       metervalue=meter;

   }

   public void CalculateinMeter(){

       centemetervalue=metervalue*100;

   }

   public void Display(){

       System.out.println(centemetervalue);

   }

}

Explanation:

Similar questions