A software company sells a package that retails for 99 Quant
A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 1019 20% 2049 30% 5099 40% 100 or more 50% Design a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. Can you help me solve this in c# for the starting out with Visual C# 2012 textbook pg. 263 #7
Solution
Answer:
Program Code:
using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
 namespace ToCheckDiscount
 {
    class Program
    {
        static void Main(string[] args)
        {
               Console.WriteLine(\"Enter no of packages purchased\");
             int n = int.Parse(Console.ReadLine());
             int amount = n * 99;
             double discount = 0;
                if (n >= 10 && n <= 19)
                 discount = amount * 0.2;
               
                else if (n >= 20 && n <= 49)
                 discount = amount * 0.3;
               
                else if (n >= 50 && n <= 99)
                 discount = amount * 0.4;
               
                else if (n >= 100 )
                 discount = amount * 0.5;
             Console.WriteLine(\"Total Amount $\" + amount);
             Console.WriteLine(\"Discount Amount $\" + discount);
             Console.WriteLine(\"Total Net Amount $\" + (amount - discount));
       }
    }
 }
Sample Output:
Enter no of packages purchased
25
Total Amount $2475
Discount Amount $742.5
Total Net Amount $1732.5

