diff --git a/Csharp/Bankrekening/Program.cs b/Csharp/Bankrekening/Program.cs index 11d0459..33bc215 100644 --- a/Csharp/Bankrekening/Program.cs +++ b/Csharp/Bankrekening/Program.cs @@ -3,15 +3,12 @@ using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; -#region Bankrekening Class -// Class representing a bank account class Bankrekening { - public string Rekeningnummer { get; } // Account number - private decimal saldo; // Account balance - private List transacties; // List of transactions + public string Rekeningnummer { get; } + private decimal saldo; + private List transacties; - // Constructor to initialize account number and starting balance public Bankrekening(string rekeningnummer, decimal beginsaldo) { Rekeningnummer = rekeningnummer; @@ -19,7 +16,6 @@ class Bankrekening transacties = new List(); } - // Method to deposit money into the account with a description public void Storten(decimal bedrag, string beschrijving) { if (bedrag > 0) @@ -33,7 +29,6 @@ class Bankrekening } } - // Method to withdraw money from the account with a description public void Opnemen(decimal bedrag, string beschrijving) { if (bedrag > 0 && bedrag <= saldo) @@ -47,29 +42,23 @@ class Bankrekening } } - // Method to check the current balance public decimal ControleerSaldo() { return saldo; } - // Method to get the transaction history public List GetTransactieGeschiedenis() { return transacties; } } -#endregion -#region Transactie Class -// Class representing a transaction class Transactie { - public decimal Bedrag { get; } // Transaction amount - public string Beschrijving { get; } // Transaction description - public DateTime Datum { get; } // Transaction date + public decimal Bedrag { get; } + public string Beschrijving { get; } + public DateTime Datum { get; } - // Constructor to initialize transaction details public Transactie(decimal bedrag, string beschrijving) { Bedrag = bedrag; @@ -77,21 +66,17 @@ class Transactie Datum = DateTime.Now; } } -#endregion -#region MainForm Class -// Main form for the application public class MainForm : Form { - private Bankrekening mijnRekening; // Bank account instance - private Label saldoLabel; // Label to display balance - private TextBox bedragTextBox; // TextBox to input amount - private TextBox beschrijvingTextBox; // TextBox to input transaction description - private Button stortenButton; // Button to deposit money - private Button opnemenButton; // Button to withdraw money - private Button transactieGeschiedenisButton; // Button to view transaction history + private Bankrekening mijnRekening; + private Label saldoLabel; + private TextBox bedragTextBox; + private TextBox beschrijvingTextBox; + private Button stortenButton; + private Button opnemenButton; + private Button transactieGeschiedenisButton; - // Constructor to initialize the form and its controls public MainForm() { mijnRekening = new Bankrekening("NL01BANK0123456789", 1000); @@ -116,7 +101,7 @@ public class MainForm : Form BackColor = Color.White, ForeColor = Color.Black, BorderStyle = BorderStyle.FixedSingle, - PlaceholderText = "Aantal" // Placeholder text + PlaceholderText = "Aantal" }; beschrijvingTextBox = new TextBox() { @@ -127,7 +112,7 @@ public class MainForm : Form BackColor = Color.White, ForeColor = Color.Black, BorderStyle = BorderStyle.FixedSingle, - PlaceholderText = "Beschrijving" // Placeholder text + PlaceholderText = "Beschrijving" }; stortenButton = new Button() { @@ -135,7 +120,7 @@ public class MainForm : Form Top = 140, Left = 20, Width = 260, - Height = 50, // Adjusted height + Height = 50, Font = new Font("Arial", 14), BackColor = Color.FromArgb(0, 123, 255), ForeColor = Color.White, @@ -147,9 +132,9 @@ public class MainForm : Form Top = 200, Left = 20, Width = 260, - Height = 50, // Adjusted height - BackColor = Color.FromArgb(0, 123, 255), // Lighter blue - Font = new Font("Arial", 14, FontStyle.Bold), // Bold and larger font + Height = 50, + BackColor = Color.FromArgb(0, 123, 255), + Font = new Font("Arial", 14, FontStyle.Bold), ForeColor = Color.White, FlatStyle = FlatStyle.Flat }; @@ -159,22 +144,20 @@ public class MainForm : Form Top = 260, Left = 20, Width = 260, - Height = 50, // Adjusted height + Height = 50, Font = new Font("Arial", 14), BackColor = Color.FromArgb(108, 117, 125), ForeColor = Color.White, FlatStyle = FlatStyle.Flat }; - // Event handlers for button clicks stortenButton.Click += StortenButton_Click; opnemenButton.Click += OpnemenButton_Click; transactieGeschiedenisButton.Click += TransactieGeschiedenisButton_Click; - // Add controls to the form Controls.Add(saldoLabel); Controls.Add(bedragTextBox); - Controls.Add(beschrijvingTextBox); // Add the new TextBox to the form + Controls.Add(beschrijvingTextBox); Controls.Add(stortenButton); Controls.Add(opnemenButton); Controls.Add(transactieGeschiedenisButton); @@ -185,7 +168,6 @@ public class MainForm : Form BackColor = Color.White; } - // Event handler for deposit button click private void StortenButton_Click(object sender, EventArgs e) { try @@ -201,7 +183,6 @@ public class MainForm : Form } } - // Event handler for withdraw button click private void OpnemenButton_Click(object sender, EventArgs e) { try @@ -217,7 +198,6 @@ public class MainForm : Form } } - // Event handler for transaction history button click private void TransactieGeschiedenisButton_Click(object sender, EventArgs e) { var transactieGeschiedenis = mijnRekening.GetTransactieGeschiedenis(); @@ -231,10 +211,7 @@ public class MainForm : Form MessageBox.Show(geschiedenis); } } -#endregion -#region Program Class -// Main program class class Program { static void Main() @@ -254,4 +231,3 @@ class Program Application.Run(new MainForm()); } } -#endregion diff --git a/Csharp/Calc/Calc.csproj b/Csharp/Calc/Calc.csproj new file mode 100644 index 0000000..fd4bd08 --- /dev/null +++ b/Csharp/Calc/Calc.csproj @@ -0,0 +1,10 @@ + + + + Exe + net9.0 + enable + enable + + + diff --git a/Csharp/Calc/Program.cs b/Csharp/Calc/Program.cs new file mode 100644 index 0000000..e880cbd --- /dev/null +++ b/Csharp/Calc/Program.cs @@ -0,0 +1,47 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + Console.WriteLine("Enter the first number:"); + double num1 = Convert.ToDouble(Console.ReadLine()); + + Console.WriteLine("Enter an operator (+, -, *, /):"); + string op = Console.ReadLine(); + + Console.WriteLine("Enter the second number:"); + double num2 = Convert.ToDouble(Console.ReadLine()); + + double result = 0; + + switch (op) + { + case "+": + result = num1 + num2; + break; + case "-": + result = num1 - num2; + break; + case "*": + result = num1 * num2; + break; + case "/": + if (num2 != 0) + { + result = num1 / num2; + } + else + { + Console.WriteLine("Cannot divide by zero."); + return; + } + break; + default: + Console.WriteLine("Invalid operator."); + return; + } + + Console.WriteLine("The result is: " + result); + } +} diff --git a/Csharp/Calc/bin/Debug/net9.0/Calc.deps.json b/Csharp/Calc/bin/Debug/net9.0/Calc.deps.json new file mode 100644 index 0000000..1c1ea81 --- /dev/null +++ b/Csharp/Calc/bin/Debug/net9.0/Calc.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "Calc/1.0.0": { + "runtime": { + "Calc.dll": {} + } + } + } + }, + "libraries": { + "Calc/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Csharp/Calc/bin/Debug/net9.0/Calc.dll b/Csharp/Calc/bin/Debug/net9.0/Calc.dll new file mode 100644 index 0000000..1a84b5a Binary files /dev/null and b/Csharp/Calc/bin/Debug/net9.0/Calc.dll differ diff --git a/Csharp/Calc/bin/Debug/net9.0/Calc.exe b/Csharp/Calc/bin/Debug/net9.0/Calc.exe new file mode 100644 index 0000000..0ce76c5 Binary files /dev/null and b/Csharp/Calc/bin/Debug/net9.0/Calc.exe differ diff --git a/Csharp/Calc/bin/Debug/net9.0/Calc.pdb b/Csharp/Calc/bin/Debug/net9.0/Calc.pdb new file mode 100644 index 0000000..ee4da11 Binary files /dev/null and b/Csharp/Calc/bin/Debug/net9.0/Calc.pdb differ diff --git a/Csharp/Calc/bin/Debug/net9.0/Calc.runtimeconfig.json b/Csharp/Calc/bin/Debug/net9.0/Calc.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/Csharp/Calc/bin/Debug/net9.0/Calc.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/Csharp/Calc/obj/Calc.csproj.nuget.dgspec.json b/Csharp/Calc/obj/Calc.csproj.nuget.dgspec.json new file mode 100644 index 0000000..6c89773 --- /dev/null +++ b/Csharp/Calc/obj/Calc.csproj.nuget.dgspec.json @@ -0,0 +1,71 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Calc\\Calc.csproj": {} + }, + "projects": { + "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Calc\\Calc.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Calc\\Calc.csproj", + "projectName": "Calc", + "projectPath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Calc\\Calc.csproj", + "packagesPath": "C:\\Users\\steen\\.nuget\\packages\\", + "outputPath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Calc\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\steen\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.102/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/Csharp/Calc/obj/Calc.csproj.nuget.g.props b/Csharp/Calc/obj/Calc.csproj.nuget.g.props new file mode 100644 index 0000000..a213501 --- /dev/null +++ b/Csharp/Calc/obj/Calc.csproj.nuget.g.props @@ -0,0 +1,16 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\steen\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 6.12.2 + + + + + + \ No newline at end of file diff --git a/Csharp/Calc/obj/Calc.csproj.nuget.g.targets b/Csharp/Calc/obj/Calc.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/Csharp/Calc/obj/Calc.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Csharp/Calc/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs b/Csharp/Calc/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs new file mode 100644 index 0000000..feda5e9 --- /dev/null +++ b/Csharp/Calc/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")] diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.AssemblyInfo.cs b/Csharp/Calc/obj/Debug/net9.0/Calc.AssemblyInfo.cs new file mode 100644 index 0000000..1b67975 --- /dev/null +++ b/Csharp/Calc/obj/Debug/net9.0/Calc.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Calc")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0115f24bd329294b808413765fcc763d93bc37e4")] +[assembly: System.Reflection.AssemblyProductAttribute("Calc")] +[assembly: System.Reflection.AssemblyTitleAttribute("Calc")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.AssemblyInfoInputs.cache b/Csharp/Calc/obj/Debug/net9.0/Calc.AssemblyInfoInputs.cache new file mode 100644 index 0000000..51a496a --- /dev/null +++ b/Csharp/Calc/obj/Debug/net9.0/Calc.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +276b6d2fabd17a789d893766bd5f14d8a26bf2628a8f4edbd75b2e58615ec557 diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.GeneratedMSBuildEditorConfig.editorconfig b/Csharp/Calc/obj/Debug/net9.0/Calc.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..b254302 --- /dev/null +++ b/Csharp/Calc/obj/Debug/net9.0/Calc.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.TargetFramework = net9.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Calc +build_property.ProjectDir = C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = +build_property.EffectiveAnalysisLevelStyle = 9.0 +build_property.EnableCodeStyleSeverity = diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.GlobalUsings.g.cs b/Csharp/Calc/obj/Debug/net9.0/Calc.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/Csharp/Calc/obj/Debug/net9.0/Calc.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.assets.cache b/Csharp/Calc/obj/Debug/net9.0/Calc.assets.cache new file mode 100644 index 0000000..64799f0 Binary files /dev/null and b/Csharp/Calc/obj/Debug/net9.0/Calc.assets.cache differ diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.csproj.CoreCompileInputs.cache b/Csharp/Calc/obj/Debug/net9.0/Calc.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..e39ca2d --- /dev/null +++ b/Csharp/Calc/obj/Debug/net9.0/Calc.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +21ebf20558f3a8283623941054716441fde654c370d1e96b36a0c9189e80a917 diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.csproj.FileListAbsolute.txt b/Csharp/Calc/obj/Debug/net9.0/Calc.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..98495b8 --- /dev/null +++ b/Csharp/Calc/obj/Debug/net9.0/Calc.csproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\bin\Debug\net9.0\Calc.exe +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\bin\Debug\net9.0\Calc.deps.json +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\bin\Debug\net9.0\Calc.runtimeconfig.json +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\bin\Debug\net9.0\Calc.dll +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\bin\Debug\net9.0\Calc.pdb +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\Calc.GeneratedMSBuildEditorConfig.editorconfig +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\Calc.AssemblyInfoInputs.cache +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\Calc.AssemblyInfo.cs +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\Calc.csproj.CoreCompileInputs.cache +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\Calc.sourcelink.json +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\Calc.dll +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\refint\Calc.dll +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\Calc.pdb +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\Calc.genruntimeconfig.cache +C:\Users\steen\Desktop\Alvin\ict-algemeen-opdrachten\Csharp\Calc\obj\Debug\net9.0\ref\Calc.dll diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.dll b/Csharp/Calc/obj/Debug/net9.0/Calc.dll new file mode 100644 index 0000000..1a84b5a Binary files /dev/null and b/Csharp/Calc/obj/Debug/net9.0/Calc.dll differ diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.genruntimeconfig.cache b/Csharp/Calc/obj/Debug/net9.0/Calc.genruntimeconfig.cache new file mode 100644 index 0000000..007282c --- /dev/null +++ b/Csharp/Calc/obj/Debug/net9.0/Calc.genruntimeconfig.cache @@ -0,0 +1 @@ +82eecd7a73df33983d8541ae507d20861bfad7cf0473104c027e197a87f8fb70 diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.pdb b/Csharp/Calc/obj/Debug/net9.0/Calc.pdb new file mode 100644 index 0000000..ee4da11 Binary files /dev/null and b/Csharp/Calc/obj/Debug/net9.0/Calc.pdb differ diff --git a/Csharp/Calc/obj/Debug/net9.0/Calc.sourcelink.json b/Csharp/Calc/obj/Debug/net9.0/Calc.sourcelink.json new file mode 100644 index 0000000..53514c9 --- /dev/null +++ b/Csharp/Calc/obj/Debug/net9.0/Calc.sourcelink.json @@ -0,0 +1 @@ +{"documents":{"C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\*":"https://raw.githubusercontent.com/Alvin-Zilverstand/ict-algemeen-opdrachten/0115f24bd329294b808413765fcc763d93bc37e4/*"}} \ No newline at end of file diff --git a/Csharp/Calc/obj/Debug/net9.0/apphost.exe b/Csharp/Calc/obj/Debug/net9.0/apphost.exe new file mode 100644 index 0000000..0ce76c5 Binary files /dev/null and b/Csharp/Calc/obj/Debug/net9.0/apphost.exe differ diff --git a/Csharp/Calc/obj/Debug/net9.0/ref/Calc.dll b/Csharp/Calc/obj/Debug/net9.0/ref/Calc.dll new file mode 100644 index 0000000..d3d44f3 Binary files /dev/null and b/Csharp/Calc/obj/Debug/net9.0/ref/Calc.dll differ diff --git a/Csharp/Calc/obj/Debug/net9.0/refint/Calc.dll b/Csharp/Calc/obj/Debug/net9.0/refint/Calc.dll new file mode 100644 index 0000000..d3d44f3 Binary files /dev/null and b/Csharp/Calc/obj/Debug/net9.0/refint/Calc.dll differ diff --git a/Csharp/Calc/obj/project.assets.json b/Csharp/Calc/obj/project.assets.json new file mode 100644 index 0000000..3574fa4 --- /dev/null +++ b/Csharp/Calc/obj/project.assets.json @@ -0,0 +1,77 @@ +{ + "version": 3, + "targets": { + "net9.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net9.0": [] + }, + "packageFolders": { + "C:\\Users\\steen\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Calc\\Calc.csproj", + "projectName": "Calc", + "projectPath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Calc\\Calc.csproj", + "packagesPath": "C:\\Users\\steen\\.nuget\\packages\\", + "outputPath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Calc\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\steen\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config" + ], + "originalTargetFrameworks": [ + "net9.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + }, + "SdkAnalysisLevel": "9.0.100" + }, + "frameworks": { + "net9.0": { + "targetAlias": "net9.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\9.0.102/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/Csharp/Calc/obj/project.nuget.cache b/Csharp/Calc/obj/project.nuget.cache new file mode 100644 index 0000000..9d5dfd1 --- /dev/null +++ b/Csharp/Calc/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "9F8x5AdxozU=", + "success": true, + "projectFilePath": "C:\\Users\\steen\\Desktop\\Alvin\\ict-algemeen-opdrachten\\Csharp\\Calc\\Calc.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file diff --git a/Csharp/Gokspel/Program.cs b/Csharp/Gokspel/Program.cs index 15543ee..19b3015 100644 --- a/Csharp/Gokspel/Program.cs +++ b/Csharp/Gokspel/Program.cs @@ -16,39 +16,31 @@ class Program : Form public Program() { - // Initialize the random number to guess numberToGuess = random.Next(1, 101); - - // Set up the form this.Text = "Gokspel"; this.Size = new System.Drawing.Size(300, 200); - // Create and add the prompt label Label promptLabel = new Label(); promptLabel.Text = "Raad het getal tussen 1 en 100:"; promptLabel.Location = new System.Drawing.Point(10, 20); promptLabel.AutoSize = true; this.Controls.Add(promptLabel); - // Create and add the input box inputBox = new TextBox(); inputBox.Location = new System.Drawing.Point(10, 50); this.Controls.Add(inputBox); - // Create and add the guess button guessButton = new Button(); guessButton.Text = "Gok"; guessButton.Location = new System.Drawing.Point(10, 80); guessButton.Click += new EventHandler(GuessButton_Click); this.Controls.Add(guessButton); - // Create and add the result label resultLabel = new Label(); resultLabel.Location = new System.Drawing.Point(10, 110); resultLabel.AutoSize = true; this.Controls.Add(resultLabel); - // Create and add the restart button (initially hidden) restartButton = new Button(); restartButton.Text = "Opnieuw"; restartButton.Location = new System.Drawing.Point(10, 140); @@ -56,7 +48,6 @@ class Program : Form restartButton.Visible = false; this.Controls.Add(restartButton); - // Set up the confetti timer confettiTimer = new System.Windows.Forms.Timer(); confettiTimer.Interval = 30; confettiTimer.Tick += new EventHandler(ConfettiTimer_Tick); @@ -79,7 +70,7 @@ class Program : Form { resultLabel.Text = "Gefeliciteerd! Je hebt het juiste getal geraden."; StartConfetti(); - restartButton.Visible = true; // Show the restart button + restartButton.Visible = true; } } else @@ -90,19 +81,17 @@ class Program : Form private void RestartButton_Click(object sender, EventArgs e) { - // Reset the game numberToGuess = random.Next(1, 101); resultLabel.Text = ""; inputBox.Text = ""; confettiList.Clear(); confettiTimer.Stop(); - restartButton.Visible = false; // Hide the restart button + restartButton.Visible = false; this.Invalidate(); } private void StartConfetti() { - // Initialize confetti confettiList.Clear(); for (int i = 0; i < 100; i++) { @@ -113,7 +102,6 @@ class Program : Form private void ConfettiTimer_Tick(object sender, EventArgs e) { - // Update confetti positions for (int i = 0; i < confettiList.Count; i++) { confettiList[i].Update(); @@ -124,7 +112,6 @@ class Program : Form protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); - // Draw confetti foreach (var confetti in confettiList) { e.Graphics.FillEllipse(new SolidBrush(confetti.Color), confetti.Position.X, confetti.Position.Y, confetti.Size, confetti.Size); @@ -149,7 +136,6 @@ class Confetti public Confetti(Random random, Size clientSize) { - // Initialize confetti properties Position = new PointF(random.Next(clientSize.Width), random.Next(clientSize.Height)); SpeedY = (float)(random.NextDouble() * 2 + 1); SpeedX = (float)(random.NextDouble() * 2 - 1); @@ -159,8 +145,7 @@ class Confetti public void Update() { - // Update confetti position and apply gravity Position = new PointF(Position.X + SpeedX, Position.Y + SpeedY); - SpeedY += 0.1f; // gravity effect + SpeedY += 0.1f; } }