Advertisement
IvanITD

6 / d) - Architect Arithmetic - Taj Mahal with one Method

Jan 24th, 2024 (edited)
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | Source Code | 0 0
  1. namespace Architect_Arithmetic__TajMahalWithOneMethod
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             CalculateTotalCost();
  8.         }
  9.  
  10.         static void CalculateTotalCost(
  11.             double length = 90.5,
  12.             double width = 90.5,
  13.             double bottom = 24.0,
  14.             double height = 24.0
  15.         )
  16.         {
  17.             double rectangleArea = length * width;
  18.             double triangleArea = bottom * height;
  19.             triangleArea *= 4;
  20.  
  21.             double flooringMaterialCost = 180;
  22.            
  23.             double totalShapeArea = rectangleArea + triangleArea;
  24.             double totalCost = totalShapeArea * flooringMaterialCost;
  25.             Console.WriteLine($"The total cost of the flooring material for the Taj Mahal is {totalCost} rupee!");
  26.  
  27.         }
  28.    
  29.     }
  30. }
Tags: C#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement