PI06 i PI06-1. Docker definitions for MSSQL and Postgres. Data seeder/generator for countries and people. Entity Framework example with variants for Postgres and MSSQL
This commit is contained in:
14
DefensiveProgramming/Barricades/Program.cs
Normal file
14
DefensiveProgramming/Barricades/Program.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Barricades;
|
||||
using System.Text;
|
||||
|
||||
Console.OutputEncoding = Encoding.UTF8;
|
||||
|
||||
Course c = new Course("PI");
|
||||
c["Pero"] = 2;
|
||||
c["Ana"] = 5;
|
||||
c["Ivan"] = 5;
|
||||
c["Marko"] = 1;
|
||||
c["Luka"] = 3;
|
||||
//c["Marija"] = -7; //should throw an exception
|
||||
Console.WriteLine("Average grade: " + c.AverageGrade());
|
||||
Console.WriteLine("Šime has grade: " + c["Šime"]); //prints -1
|
||||
Reference in New Issue
Block a user