using System;
namespace PrintPrice
{
class Price
{
const int maximumLineNumber = 50;
const int pageLength = 20;
const int pricePerLicense = 1100;
const int packageOfLicenses = 10;
static void Main()
{
int lineNumber;
int quantityOfLicenses;
int totalForLicenses;
int pricePerLicense;
int maximumLineNumber;
int pageLength;
int packageOfLicenses;
Console.Write("Enter a price per license: ");
if (!int.TryParse(Console.ReadLine(), out pricePerLicense))
{
pricePerLicense = Price.pricePerLicense;
Console.WriteLine("Automatically the price per license is: " + pricePerLicense);
Console.WriteLine();
}
Console.Write("Enter a maximum line number: ");
if (!int.TryParse(Console.ReadLine(), out maximumLineNumber))
{
maximumLineNumber = Price.maximumLineNumber;
Console.WriteLine("Automatically the maximum line number is: " + maximumLineNumber);
Console.WriteLine();
}
Console.Write("Enter a page length per output: ");
if (!int.TryParse(Console.ReadLine(), out pageLength))
{
pageLength = Price.pageLength;
Console.WriteLine("Automatically the page length per output is: " + pageLength);
Console.WriteLine();
}
Console.Write("Enter a package of licenses: ");
if (!int.TryParse(Console.ReadLine(), out packageOfLicenses))
{
packageOfLicenses = Price.packageOfLicenses;
Console.WriteLine("Automatically the package of licenses is: " + packageOfLicenses);
Console.WriteLine();
}
;
int discount = 3500;
int numberOfLicenses = 1;
for (lineNumber = 1; lineNumber <= maximumLineNumber; lineNumber++)
{
if (packageOfLicenses == (10 * numberOfLicenses))
{
discount = 3500 * lineNumber;
quantityOfLicenses = packageOfLicenses * lineNumber;
totalForLicenses = quantityOfLicenses * pricePerLicense;
Console.WriteLine("Line " + lineNumber + ": "
+ quantityOfLicenses + " Licenses "
+ "cost " + (totalForLicenses - discount));
}
if ((lineNumber % pageLength) == 0) Console.ReadKey();
}
Console.ReadKey();
}
}
}
please someone help me with this. :(
i need the output like this
10 licenses costs only 7500
20 licenses costs only 15000
line 1: licence PHP 1100
line 2: licenses PHP 2200
line 3: licenses PHP 3300
line 4: licenses PHP 4400
line 5: licenses PHP 5500
line 6: licenses PHP 6600
line 7: licenses PHP 7700
line 8: licenses PHP 8800
line 9: licenses PHP 9900
line 10: licenses PHP 7500
line 11: licenses PHP 8600
line 12: licenses PHP 9700
:
line 300 licenses PHP ….