Weewee21

PriceWithDiscountWithoutDiscountCalculationProducts

Sep 23rd, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp6
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("\nWelcome to the Umbrella-Shop 3000!");
  10.  
  11.             Console.WriteLine("\n========================");
  12.  
  13.             double PriceOfUmbrellas, Discount, PriceBeforeDiscount, PriceAfterDiscount, DiscountOfPrice;
  14.  
  15.             int QuantityOfUmbrellas;
  16.  
  17.             Discount = (0.1); // Known Discount Percentage
  18.  
  19.             Console.Write("\nPlease Enter the Price per Umbrella: "); // Inputs for evaluating the Umbrella Properties i.e. Price, Quantity, Total, etc...
  20.             PriceOfUmbrellas = double.Parse(Console.ReadLine());
  21.  
  22.             Console.Write("\nPlease Enter the Quantity of Umbrellas: ");
  23.             QuantityOfUmbrellas = int.Parse(Console.ReadLine());
  24.  
  25.             Console.WriteLine("\n========================");
  26.  
  27.             Console.WriteLine("\nCalculating...");
  28.  
  29.             PriceBeforeDiscount = (PriceOfUmbrellas * QuantityOfUmbrellas); // Non-Discount & Discount Calculations
  30.  
  31.             DiscountOfPrice = (PriceBeforeDiscount * Discount); // How Much to Subtract from the PriceBeforeDiscount to figure out Discount Price
  32.  
  33.             PriceAfterDiscount = (PriceBeforeDiscount - DiscountOfPrice);
  34.  
  35.             Console.WriteLine("\nIt is known that for buying an umbrella the consumer is entitled to a 10% discount.");
  36.  
  37.             Console.WriteLine("\n========================");
  38.  
  39.             Console.WriteLine("\nTotal Price Before Discount: {0} NIS", PriceBeforeDiscount); // Printing out the PriceBeforeDiscount & PriceAfterDiscount
  40.  
  41.             Console.WriteLine("\nTotal Price After Discount: {0} NIS", PriceAfterDiscount);
  42.  
  43.             Console.WriteLine("\n========================");
  44.         }
  45.     }
  46. }
  47.  
Add Comment
Please, Sign In to add comment