Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

//Carpet

//Purchase.cs
using
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;
System.Threading.Tasks;

namespace Carpet
{
class CARPET
{
double width, length, total, COE, j;
string text, output;
public CARPET()
{}
public string Process(double wid, double len, string tex)
{
width = wid;
length = len;
text =tex;
COE = getPrice(text);
total = getTotal(length, width, COE);
output = String.Format("{0:C}", total);
}

return output;

public double getPrice(string i)


{
switch (i)
{
case "CLASS A ($ 10)":
j = 10;
break;
case "CLASS B ($ 8)":
j = 8;
break;
case "CLASS C ($ 5)":
j = 5;
break;
}
return j;
}
public double getTotal(double a, double b, double c)
{
return a * b * c;
}
}

//Program.cs

using
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Threading.Tasks;
System.Windows.Forms;

namespace Carpet
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

You might also like