/******************************************************/ /* Introduction to Programming */ /* By Dr. ANTF */ /* www.antf.net */ /* Copyright 2015 */ /* */ /* C# 405 - Problem 4: Grass Cutting (a) */ /******************************************************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DOS { class Program { static int Area(int width, int height) { return width * height; } static void Main(string[] args) { int land_w, land_h, buld1_w, buld1_h, buld2_w, buld2_h, area; Console.Write("Please enter Land width: "); land_w = int.Parse(Console.ReadLine()); Console.Write("Please enter Land height: "); land_h = int.Parse(Console.ReadLine()); Console.Write("Please enter Building 1 width: "); buld1_w = int.Parse(Console.ReadLine()); Console.Write("Please enter Building 1 height: "); buld1_h = int.Parse(Console.ReadLine()); Console.Write("Please enter Building 2 width: "); buld2_w = int.Parse(Console.ReadLine()); Console.Write("Please enter Building 2 width: "); buld2_h = int.Parse(Console.ReadLine()); area = Area(land_w, land_h) - Area(buld1_w, buld1_h) - Area(buld2_w, buld2_h); Console.WriteLine("\n\nTotal time needed to cut the grass is: {0} min", area * 5); Console.ReadKey(); } } }