Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace P01.ClassBoxData
- {
- public class Program
- {
- public static void Main()
- {
- double length = double.Parse(Console.ReadLine());
- double width = double.Parse(Console.ReadLine());
- double height = double.Parse(Console.ReadLine());
- Box box = null;
- try
- {
- box = new Box(length, width, height);
- }
- catch (ArgumentException ae)
- {
- Console.WriteLine(ae.Message);
- return;
- }
- Console.WriteLine($"Surface Area - {box.SurfaceArea():f2}");
- Console.WriteLine($"Lateral Surface Area - {box.LateralSurfaceArea():f2}");
- Console.WriteLine($"Volume - {box.Volume():f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement