Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Apartment
- {
- private double kitchenLength;
- private double kitchenWidth;
- private double denLength;
- private double denWidth;
- private double bedroomLength;
- private double bedroomWidth;
- public Apartment()
- {
- kitchenLength = 0;
- kitchenWidth = 0;
- denLength = 0;
- denWidth = 0;
- bedroomLength = 0;
- bedroomWidth = 0;
- }
- public void setKitchenLength(double kitchenLength)
- {
- this.kitchenLength = kitchenLength;
- }
- public void setKitchenWidth(double kitchenWidth)
- {
- this.kitchenWidth = kitchenWidth;
- }
- public void setDenLength(double denLength)
- {
- this.denLength = denLength;
- }
- public void setDenWidth(double denWidth)
- {
- this.denWidth = denWidth;
- }
- public void setBedroomLength(double bedroomLength)
- {
- this.bedroomLength = bedroomLength;
- }
- public void setBedroomWidth(double bedroomWidth)
- {
- this.bedroomWidth = bedroomWidth;
- }
- public double getKitchenLength()
- {
- return kitchenLength;
- }
- public double getKitchenWidth()
- {
- return kitchenWidth;
- }
- public double getDenLength()
- {
- return denLength;
- }
- public double getDenWidth()
- {
- return denWidth;
- }
- public double getBedroomLength()
- {
- return bedroomLength;
- }
- public double getBedroomWidth()
- {
- return bedroomWidth;
- }
- public double getKitchenArea()
- {
- return kitchenLength * kitchenWidth;
- }
- public double getDenArea()
- {
- return denLength * denWidth;
- }
- public double getBedroomArea()
- {
- return bedroomLength * bedroomWidth;
- }
- public double getTotalArea()
- {
- return getKitchenArea() + getDenArea() + getBedroomArea();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement