Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace class1
- {
- public class Paralelepiped
- {
- public double Width { get; set; }
- public double Length { get; set; }
- public double Height { get; set; }
- public Paralelepiped(double width, double length, double height)
- {
- this.Width = width;
- this.Length = length;
- this.Height = height;
- }
- public double Volume()
- {
- return Width * Length * Height;
- }
- public double SideArea()
- {
- return (Width * 2 + Length * 2) * Height;
- }
- public double FullArea()
- {
- return (Width * 2 + Length * 2) * Height + Width * Length * 2;
- }
- public override string ToString()
- {
- return string.Format("size: {0}x{1}x{2}, V={3}, S={4}, S1={5}",
- Width, Length, Height, Volume(), SideArea(), FullArea());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement