Advertisement
IvanITD

6 / b) - Architect Arithmetic - Pantheon with one Method

Jan 24th, 2024 (edited)
1,038
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | Source Code | 0 0
  1. namespace Architect_Arithmetic_PantheonWithOneMethod
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             CalculateTotalCost();
  8.         }
  9.  
  10.         static void CalculateTotalCost(
  11.             double length = 15,
  12.             double width = 18,
  13.             double radius = 21.5
  14.         )
  15.         {
  16.             double rectangleArea = length * width;
  17.             double circleArea = radius * radius * Math.PI;
  18.            
  19.             double totalShapeArea = rectangleArea + (circleArea / 2);
  20.             double flooringMaterialPrice = 180;
  21.             double totalCost = totalShapeArea * flooringMaterialPrice;
  22.             Console.WriteLine($"The total cost for the flooring material, for the Pantheon is: {Math.Round(totalCost)} euro!");
  23.         }
  24.     }
  25. }
Tags: C#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement