Round #574
09 May 2026, 23:16· csharp· Meta-Llama-3.3-70B-Instruct· r13-clean-hints
- Complexity
- band 0
- ZP / UO / OBS
- 0 / 0 / 0
- Journey weight
- 0
- Lightshift ΔL
- —
Prompt
Calculate the percentage of total sales each product represents.
Zero-point index (what the engine surfaced)
ZPI-ZPI-0008 | 2026-05-09T23:16:52Z
Calculate the percentage of total sales each product represents.
ZERO POINT — 0 entries (structural invariants)
UNOBSERVED — 0 entries (implied truths)
OBSERVED — 0 entries (explicit in request)
COMPLEXITY │ 0 entries │ spread: 0° │ band: LOW
Baseline response (no ZPI)
```csharp
using System;
using System.Data;
class Program
{
static void Main()
{
// Create a DataTable
DataTable dt = new DataTable();
dt.Columns.Add("Product", typeof(string));
dt.Columns.Add("Sales", typeof(int));
dt.Rows.Add("Product A", 1000);
dt.Rows.Add("Product B", 2000);
dt.Rows.Add("Product C", 3000);
dt.Rows.Add("Product D", 4000);
dt.Rows.Add("Product E", 5000);
// Calculate the total sales
int totalSales = 0;
foreach (DataRow row in dt.Rows)
{
totalSales += Convert.ToInt32(row["Sales"]);
}
// Calculate the percentage of total sales for each product
foreach (DataRow row in dt.Rows)
{
double percentage = (Convert.ToInt32(row["Sales"]) / (double)totalSales) * 100;
Console.WriteLine($"{row["Product"]}: {percentage:F2}%");
}
}
}
```
Enhanced response (with ZPI)
```csharp
using System;
using System.Collections.Generic;
using System.Linq;
public class ProductSales
{
public string ProductName { get; set; }
public decimal Sales { get; set; }
}
public class SalesCalculator
{
public Dictionary<string, decimal> CalculateProductSalesPercentage(List<ProductSales> productSales)
{
// Calculate total sales
decimal totalSales = productSales.Sum(ps => ps.Sales);
// Calculate percentage of total sales for each product
var productSalesPercentages = productSales.ToDictionary(
ps => ps.ProductName,
ps => (ps.Sales / totalSales) * 100);
return productSalesPercentages;
}
}
class Program
{
static void Main()
{
var salesCalculator = new SalesCalculator();
var productSales = new List<ProductSales>
{
new ProductSales { ProductName = "Product A", Sales = 1000 },
new ProductSales { ProductName = "Product B", Sales = 2000 },
new ProductSales { ProductName = "Product C", Sales = 3000 },
};
var productSalesPercentages = salesCalculator.CalculateProductSalesPercentage(productSales);
foreach (var productSalesPercentage in productSalesPercentages)
{
Console.WriteLine($"{productSalesPercentage.Key}: {productSalesPercentage.Value:F2}%");
}
}
}
```
This C# code calculates the percentage of total sales each product represents. It defines a `ProductSales` class to hold the product name and sales amount, and a `SalesCalculator` class with a method to calculate the sales percentages.
Here's a step-by-step explanation:
1. **Define the data model**: The `ProductSales` class represents a product with its name and sales amount.
2. **Create a sales calculator**: The `SalesCalculator` class contains a method `CalculateProductSalesPercentage` that takes a list of `ProductSales` objects as input.
3. **Calculate total sales**: The method calculates the total sales by summing up the sales amounts of all products using LINQ's `Sum` method.
4. **Calculate sales percentages**: It then calculates the percentage of total sales for each product by dividing the product's sales amount by the total sales and multiplying by 100. The results are stored in a dictionary with the product name as the key.
5. **Example usage**: In the `Main` method, an instance of `SalesCalculator` is created, and a list of `ProductSales` objects is defined. The `CalculateProductSalesPercentage` method is called, and the resulting dictionary is iterated over to print the sales percentages for each product.
The code uses LINQ for concise data processing and follows standard C# naming conventions and coding practices. The example usage demonstrates how to use the `SalesCalculator` class to calculate and display the sales percentages for a given set of products.
Grader chain
Each grader reads the same baseline + enhanced pair and casts an independent verdict. Disagreement is the framework's own signal — not noise to be averaged away.
V1samba/Meta-Llama-3.3-70B-Instruct
BetterV4qwen2.5-coder-3b-instruct
BetterV5openrouter/qwen/qwen3-235b-a22b-2507
BetterV7qwen2.5-coder-7b-instruct
BetterV8openai/gpt-4.1
BetterV9anthropic/claude-opus-4-7
BetterV12openai/gpt-4o
BetterComments
Our grader said what it said. What do you say? Comment as a guest below.
No comments yet. Be the first to say what you make of this round.