Created
August 25, 2025 09:00
-
-
Save Amberlamps/c3f6150203fb16df46b7ddf5a2baefd8 to your computer and use it in GitHub Desktop.
Coding 1 - C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| namespace ClaimsProcessing | |
| { | |
| public class Claim | |
| { | |
| public string Id { get; set; } | |
| public decimal Amount { get; set; } | |
| public Claim(string id, decimal amount) | |
| { | |
| Id = id; | |
| Amount = amount; | |
| } | |
| } | |
| public class Insurer | |
| { | |
| public string Id { get; set; } | |
| public decimal Balance { get; set; } | |
| public Insurer(string id, decimal balance) | |
| { | |
| Id = id; | |
| Balance = balance; | |
| } | |
| } | |
| public class PayoutTransaction | |
| { | |
| public string ClaimId { get; set; } | |
| public string InsurerId { get; set; } | |
| public decimal Amount { get; set; } | |
| public PayoutTransaction(string claimId, string insurerId, decimal amount) | |
| { | |
| ClaimId = claimId; | |
| InsurerId = insurerId; | |
| Amount = amount; | |
| } | |
| } | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| List<Claim> claims = new List<Claim> | |
| { | |
| new Claim("a", 100), | |
| new Claim("b", 50), | |
| new Claim("c", 40), | |
| new Claim("d", 60), | |
| new Claim("e", 20), | |
| new Claim("f", 90), | |
| new Claim("g", 120), | |
| new Claim("h", 30) | |
| }; | |
| List<Insurer> insurers = new List<Insurer> | |
| { | |
| new Insurer("A", 250), | |
| new Insurer("B", 250), | |
| new Insurer("C", 100) | |
| }; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment