Created
December 19, 2016 18:49
-
-
Save ellenia/085d9fe7307df561759645fd6e988186 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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