[Solved] c# algorithm to calculate the discount that is subtracted from the total amount onto each purchased item instead


What is the current code you have? A C# example would look something like this:

// Assuming 'items' is an Enumerable type containing the list of items in the order
var totalCost = 0;
for (var i in items) {
// Accumulates the cost of each item at a 25% discount
totalCost += 0.75 * i.Cost;
}

solved c# algorithm to calculate the discount that is subtracted from the total amount onto each purchased item instead