Advertisement
IvanITD

6 / f) - Architect Arithmetic - Great Mosque of Mecca with one Method

Jan 24th, 2024 (edited)
865
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | Source Code | 0 0
  1. namespace ArchitectArithmeticGreatMosqueOfMeccaOneMethod
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             CalculateTotalCost();
  8.         }
  9.  
  10.         static void CalculateTotalCost(
  11.             double length1 = 284,
  12.             double width1 = 264,
  13.             double length2 = 106,
  14.             double width2 = 180,
  15.             double bottom = 264,
  16.             double height = 84
  17.             )
  18.             {
  19.                 double area1 = length1 * width1;
  20.                 double area2 = length2 * width2;
  21.                 double area = 0.5 * bottom * height;
  22.  
  23.                 double totalShapeArea = area1 + area2 + area;
  24.  
  25.                 double flooringPrice = 180;
  26.  
  27.                 double totalCost = totalShapeArea * flooringPrice;
  28.  
  29.                 Console.WriteLine($"The total cost for the flooring material, for the Great Mosque of Mecca is: {Math.Round(totalCost):F2} riyal!");
  30.             }
  31.     }
  32. }
Tags: C#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement