Skip to content

Instantly share code, notes, and snippets.

@ellenia
Created December 19, 2016 18:49
Show Gist options
  • Save ellenia/085d9fe7307df561759645fd6e988186 to your computer and use it in GitHub Desktop.
Save ellenia/085d9fe7307df561759645fd6e988186 to your computer and use it in GitHub Desktop.
namespace Sales
{
struct Order
{
public string CustomerName;
public string ProductName;
public double RetailPrice;
public int Quantity;
}
class Program
{
static void Main(string[] args)
{
Order customerOrder;
Console.Write("Customer Name: ");
customerOrder.CustomerName = Console.ReadLine();
Console.Write("Product Name: ");
customerOrder.ProductName = Console.ReadLine();
Console.Write("Retail Price: ");
customerOrder.RetailPrice = Double.Parse(Console.ReadLine());
Console.Write("Quantity: ");
customerOrder.Quantity = Int32.Parse(Console.ReadLine());
double orderTotal = customerOrder.RetailPrice * customerOrder.Quantity;
Console.WriteLine();
Console.WriteLine("Total: {0}", orderTotal);
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment