Skip to content

Instantly share code, notes, and snippets.

@codecademydev

codecademydev/Program.cs Secret

Created Mar 15, 2020
Embed
What would you like to do?
Codecademy export
using System;
namespace ArchitectArithmetic
{
class Program
{
//rect method
static double Rect (double length, double width) {
return length * width;
}
//circle method
static double Circle (double radius) {
return radius * radius * 3.14;
}
static double Triangle (double bottom, double height) {
return 0.5 * bottom * height;
}
public static void Main(string[] args)
{
double crcle = Circle(375)/2;
double rect = Rect(2600, 1500);
double tr = Triangle(500, 750);
double total = crcle + rect + tr;
double cost = total * 180;
Console.WriteLine("The total cost of this project will be: " + cost);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment