Advertisement
ZazoTazo

Lab6-2

Nov 11th, 2020
719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. //room area
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Project_2
  9. {
  10.     struct Room
  11.     {
  12.         float length;
  13.         float width;
  14.  
  15.         public Room(float length, float width)
  16.         {
  17.             this.length = length;
  18.             this.width = width;
  19.         }
  20.  
  21.         public void area()
  22.         {
  23.             Console.WriteLine("Area = {0}", this.length * this.width);
  24.         }
  25.     }
  26.  
  27.     class Program
  28.     {
  29.         static void Main(string[] args)
  30.         {
  31.             Room room = new Room(104.5f, 83f);
  32.             room.area();
  33.             Console.ReadLine();
  34.         }
  35.     }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement