From 1699ad285b7b7cd4aad7be41a0703d5e428fe55d Mon Sep 17 00:00:00 2001 From: ​ Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: future value 4 --- .../.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 | Bin 0 -> 74344 bytes .../d16d42a2-5d56-4689-a6b5-5ace011513fb.vsidx | Bin 0 -> 30933 bytes future_value4/.vs/FutureValue/v17/.futdcache.v2 | Bin 0 -> 161 bytes future_value4/.vs/FutureValue/v17/.suo | Bin 0 -> 23040 bytes .../ProjectEvaluation/futurevalue.metadata.v7.bin | Bin 0 -> 171943 bytes .../ProjectEvaluation/futurevalue.projects.v7.bin | Bin 0 -> 294712 bytes future_value4/FutureValue.sln | 25 +++ future_value4/FutureValue/FutureValue.csproj | 9 ++ future_value4/FutureValue/FutureValue.csproj.user | 8 + future_value4/FutureValue/Program.cs | 23 +++ .../bin/Debug/netcoreapp3.1/FutureValue.deps.json | 23 +++ .../bin/Debug/netcoreapp3.1/FutureValue.dll | Bin 0 -> 11264 bytes .../bin/Debug/netcoreapp3.1/FutureValue.exe | Bin 0 -> 158208 bytes .../bin/Debug/netcoreapp3.1/FutureValue.pdb | Bin 0 -> 13308 bytes .../FutureValue.runtimeconfig.dev.json | 8 + .../netcoreapp3.1/FutureValue.runtimeconfig.json | 9 ++ .../FutureValue/frmFutureValue.Designer.cs | 180 +++++++++++++++++++++ future_value4/FutureValue/frmFutureValue.cs | 132 +++++++++++++++ future_value4/FutureValue/frmFutureValue.resx | 120 ++++++++++++++ .../.NETCoreApp,Version=v3.1.AssemblyAttributes.cs | 4 + .../netcoreapp3.1/FutureValue.AssemblyInfo.cs | 23 +++ .../FutureValue.AssemblyInfoInputs.cache | 1 + ...Value.GeneratedMSBuildEditorConfig.editorconfig | 11 ++ .../Debug/netcoreapp3.1/FutureValue.assets.cache | Bin 0 -> 151 bytes .../FutureValue.csproj.BuildWithSkipAnalyzers | 0 .../FutureValue.csproj.CoreCompileInputs.cache | 1 + .../FutureValue.csproj.FileListAbsolute.txt | 15 ++ .../FutureValue.csproj.GenerateResource.cache | Bin 0 -> 72 bytes .../netcoreapp3.1/FutureValue.designer.deps.json | 11 ++ .../FutureValue.designer.runtimeconfig.json | 16 ++ .../obj/Debug/netcoreapp3.1/FutureValue.dll | Bin 0 -> 11264 bytes .../FutureValue.frmFutureValue.resources | Bin 0 -> 180 bytes .../FutureValue.genruntimeconfig.cache | 1 + .../obj/Debug/netcoreapp3.1/FutureValue.pdb | Bin 0 -> 13308 bytes .../obj/Debug/netcoreapp3.1/apphost.exe | Bin 0 -> 158208 bytes .../obj/FutureValue.csproj.nuget.dgspec.json | 66 ++++++++ .../obj/FutureValue.csproj.nuget.g.props | 15 ++ .../obj/FutureValue.csproj.nuget.g.targets | 2 + future_value4/FutureValue/obj/project.assets.json | 71 ++++++++ future_value4/FutureValue/obj/project.nuget.cache | 8 + 40 files changed, 782 insertions(+) create mode 100644 future_value4/.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 create mode 100644 future_value4/.vs/FutureValue/FileContentIndex/d16d42a2-5d56-4689-a6b5-5ace011513fb.vsidx create mode 100644 future_value4/.vs/FutureValue/v17/.futdcache.v2 create mode 100644 future_value4/.vs/FutureValue/v17/.suo create mode 100644 future_value4/.vs/ProjectEvaluation/futurevalue.metadata.v7.bin create mode 100644 future_value4/.vs/ProjectEvaluation/futurevalue.projects.v7.bin create mode 100644 future_value4/FutureValue.sln create mode 100644 future_value4/FutureValue/FutureValue.csproj create mode 100644 future_value4/FutureValue/FutureValue.csproj.user create mode 100644 future_value4/FutureValue/Program.cs create mode 100644 future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.deps.json create mode 100644 future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.dll create mode 100644 future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.exe create mode 100644 future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.pdb create mode 100644 future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.dev.json create mode 100644 future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.json create mode 100644 future_value4/FutureValue/frmFutureValue.Designer.cs create mode 100644 future_value4/FutureValue/frmFutureValue.cs create mode 100644 future_value4/FutureValue/frmFutureValue.resx create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfo.cs create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfoInputs.cache create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.GeneratedMSBuildEditorConfig.editorconfig create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.assets.cache create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.BuildWithSkipAnalyzers create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.CoreCompileInputs.cache create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.FileListAbsolute.txt create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.GenerateResource.cache create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.deps.json create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.runtimeconfig.json create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.dll create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.frmFutureValue.resources create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.genruntimeconfig.cache create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.pdb create mode 100644 future_value4/FutureValue/obj/Debug/netcoreapp3.1/apphost.exe create mode 100644 future_value4/FutureValue/obj/FutureValue.csproj.nuget.dgspec.json create mode 100644 future_value4/FutureValue/obj/FutureValue.csproj.nuget.g.props create mode 100644 future_value4/FutureValue/obj/FutureValue.csproj.nuget.g.targets create mode 100644 future_value4/FutureValue/obj/project.assets.json create mode 100644 future_value4/FutureValue/obj/project.nuget.cache diff --git a/future_value4/.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 b/future_value4/.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000..a36182a Binary files /dev/null and b/future_value4/.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 differ diff --git a/future_value4/.vs/FutureValue/FileContentIndex/d16d42a2-5d56-4689-a6b5-5ace011513fb.vsidx b/future_value4/.vs/FutureValue/FileContentIndex/d16d42a2-5d56-4689-a6b5-5ace011513fb.vsidx new file mode 100644 index 0000000..578b23a Binary files /dev/null and b/future_value4/.vs/FutureValue/FileContentIndex/d16d42a2-5d56-4689-a6b5-5ace011513fb.vsidx differ diff --git a/future_value4/.vs/FutureValue/v17/.futdcache.v2 b/future_value4/.vs/FutureValue/v17/.futdcache.v2 new file mode 100644 index 0000000..44de22b Binary files /dev/null and b/future_value4/.vs/FutureValue/v17/.futdcache.v2 differ diff --git a/future_value4/.vs/FutureValue/v17/.suo b/future_value4/.vs/FutureValue/v17/.suo new file mode 100644 index 0000000..28507ff Binary files /dev/null and b/future_value4/.vs/FutureValue/v17/.suo differ diff --git a/future_value4/.vs/ProjectEvaluation/futurevalue.metadata.v7.bin b/future_value4/.vs/ProjectEvaluation/futurevalue.metadata.v7.bin new file mode 100644 index 0000000..1626971 Binary files /dev/null and b/future_value4/.vs/ProjectEvaluation/futurevalue.metadata.v7.bin differ diff --git a/future_value4/.vs/ProjectEvaluation/futurevalue.projects.v7.bin b/future_value4/.vs/ProjectEvaluation/futurevalue.projects.v7.bin new file mode 100644 index 0000000..f41cebe Binary files /dev/null and b/future_value4/.vs/ProjectEvaluation/futurevalue.projects.v7.bin differ diff --git a/future_value4/FutureValue.sln b/future_value4/FutureValue.sln new file mode 100644 index 0000000..a3c600c --- /dev/null +++ b/future_value4/FutureValue.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30413.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FutureValue", "FutureValue\FutureValue.csproj", "{156795E2-918B-4C21-BA0E-3E6C7D916D43}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {156795E2-918B-4C21-BA0E-3E6C7D916D43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {156795E2-918B-4C21-BA0E-3E6C7D916D43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {156795E2-918B-4C21-BA0E-3E6C7D916D43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {156795E2-918B-4C21-BA0E-3E6C7D916D43}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8B31CA13-44A4-4CA8-90AD-A01B9E7D28CF} + EndGlobalSection +EndGlobal diff --git a/future_value4/FutureValue/FutureValue.csproj b/future_value4/FutureValue/FutureValue.csproj new file mode 100644 index 0000000..7b05c62 --- /dev/null +++ b/future_value4/FutureValue/FutureValue.csproj @@ -0,0 +1,9 @@ + + + + WinExe + netcoreapp3.1 + true + + + \ No newline at end of file diff --git a/future_value4/FutureValue/FutureValue.csproj.user b/future_value4/FutureValue/FutureValue.csproj.user new file mode 100644 index 0000000..5bc7468 --- /dev/null +++ b/future_value4/FutureValue/FutureValue.csproj.user @@ -0,0 +1,8 @@ + + + + + Form + + + \ No newline at end of file diff --git a/future_value4/FutureValue/Program.cs b/future_value4/FutureValue/Program.cs new file mode 100644 index 0000000..79fd42c --- /dev/null +++ b/future_value4/FutureValue/Program.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FutureValue +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.SetHighDpiMode(HighDpiMode.SystemAware); + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new frmFutureValue()); + } + } +} diff --git a/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.deps.json b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.deps.json new file mode 100644 index 0000000..3177387 --- /dev/null +++ b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v3.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v3.1": { + "FutureValue/1.0.0": { + "runtime": { + "FutureValue.dll": {} + } + } + } + }, + "libraries": { + "FutureValue/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.dll b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.dll new file mode 100644 index 0000000..0ca0ee3 Binary files /dev/null and b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.dll differ diff --git a/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.exe b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.exe new file mode 100644 index 0000000..1382b35 Binary files /dev/null and b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.exe differ diff --git a/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.pdb b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.pdb new file mode 100644 index 0000000..02807a6 Binary files /dev/null and b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.pdb differ diff --git a/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.dev.json b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.dev.json new file mode 100644 index 0000000..214bf78 --- /dev/null +++ b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.dev.json @@ -0,0 +1,8 @@ +{ + "runtimeOptions": { + "additionalProbingPaths": [ + "C:\\Users\\User\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\User\\.nuget\\packages" + ] + } +} \ No newline at end of file diff --git a/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.json b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.json new file mode 100644 index 0000000..9b3a644 --- /dev/null +++ b/future_value4/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.json @@ -0,0 +1,9 @@ +{ + "runtimeOptions": { + "tfm": "netcoreapp3.1", + "framework": { + "name": "Microsoft.WindowsDesktop.App", + "version": "3.1.0" + } + } +} \ No newline at end of file diff --git a/future_value4/FutureValue/frmFutureValue.Designer.cs b/future_value4/FutureValue/frmFutureValue.Designer.cs new file mode 100644 index 0000000..c065291 --- /dev/null +++ b/future_value4/FutureValue/frmFutureValue.Designer.cs @@ -0,0 +1,180 @@ +namespace FutureValue +{ + partial class frmFutureValue + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + btnExit = new System.Windows.Forms.Button(); + btnCalculate = new System.Windows.Forms.Button(); + txtInterestRate = new System.Windows.Forms.TextBox(); + txtMonthlyInvestment = new System.Windows.Forms.TextBox(); + label4 = new System.Windows.Forms.Label(); + label3 = new System.Windows.Forms.Label(); + label2 = new System.Windows.Forms.Label(); + label1 = new System.Windows.Forms.Label(); + cboYears = new System.Windows.Forms.ComboBox(); + lstValues = new System.Windows.Forms.ListBox(); + SuspendLayout(); + // + // btnExit + // + btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel; + btnExit.Location = new System.Drawing.Point(191, 222); + btnExit.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnExit.Name = "btnExit"; + btnExit.Size = new System.Drawing.Size(88, 27); + btnExit.TabIndex = 9; + btnExit.Text = "E&xit"; + btnExit.Click += btnExit_Click; + // + // btnCalculate + // + btnCalculate.Location = new System.Drawing.Point(90, 222); + btnCalculate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + btnCalculate.Name = "btnCalculate"; + btnCalculate.Size = new System.Drawing.Size(88, 27); + btnCalculate.TabIndex = 8; + btnCalculate.Text = "&Calculate"; + btnCalculate.Click += btnCalculate_Click; + // + // txtInterestRate + // + txtInterestRate.Location = new System.Drawing.Point(139, 43); + txtInterestRate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtInterestRate.Name = "txtInterestRate"; + txtInterestRate.Size = new System.Drawing.Size(97, 23); + txtInterestRate.TabIndex = 3; + txtInterestRate.Tag = "Yearly interest rate"; + // + // txtMonthlyInvestment + // + txtMonthlyInvestment.Location = new System.Drawing.Point(139, 10); + txtMonthlyInvestment.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + txtMonthlyInvestment.Name = "txtMonthlyInvestment"; + txtMonthlyInvestment.Size = new System.Drawing.Size(97, 23); + txtMonthlyInvestment.TabIndex = 1; + txtMonthlyInvestment.Tag = "Monthly investment"; + // + // label4 + // + label4.Location = new System.Drawing.Point(14, 106); + label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label4.Name = "label4"; + label4.Size = new System.Drawing.Size(133, 23); + label4.TabIndex = 6; + label4.Text = "Future Value:"; + label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label3 + // + label3.Location = new System.Drawing.Point(14, 74); + label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label3.Name = "label3"; + label3.Size = new System.Drawing.Size(133, 23); + label3.TabIndex = 4; + label3.Text = "Number of Years:"; + label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label2 + // + label2.Location = new System.Drawing.Point(14, 43); + label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(133, 23); + label2.TabIndex = 2; + label2.Text = "Yearly Interest Rate:"; + label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label1 + // + label1.Location = new System.Drawing.Point(14, 10); + label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(133, 23); + label1.TabIndex = 0; + label1.Text = "Monthly Investment:"; + label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // cboYears + // + cboYears.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + cboYears.FormattingEnabled = true; + cboYears.Location = new System.Drawing.Point(139, 77); + cboYears.Name = "cboYears"; + cboYears.Size = new System.Drawing.Size(98, 23); + cboYears.TabIndex = 5; + // + // lstValues + // + lstValues.FormattingEnabled = true; + lstValues.ItemHeight = 15; + lstValues.Location = new System.Drawing.Point(101, 111); + lstValues.Name = "lstValues"; + lstValues.Size = new System.Drawing.Size(168, 94); + lstValues.TabIndex = 7; + // + // frmFutureValue + // + AcceptButton = btnCalculate; + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + CancelButton = btnExit; + ClientSize = new System.Drawing.Size(294, 261); + Controls.Add(lstValues); + Controls.Add(cboYears); + Controls.Add(btnExit); + Controls.Add(btnCalculate); + Controls.Add(txtInterestRate); + Controls.Add(txtMonthlyInvestment); + Controls.Add(label4); + Controls.Add(label3); + Controls.Add(label2); + Controls.Add(label1); + Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + Name = "frmFutureValue"; + StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + Text = "Future Value"; + Load += frmFutureValue_Load; + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private System.Windows.Forms.Button btnExit; + private System.Windows.Forms.Button btnCalculate; + private System.Windows.Forms.TextBox txtInterestRate; + private System.Windows.Forms.TextBox txtMonthlyInvestment; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox cboYears; + private System.Windows.Forms.ListBox lstValues; + } +} + diff --git a/future_value4/FutureValue/frmFutureValue.cs b/future_value4/FutureValue/frmFutureValue.cs new file mode 100644 index 0000000..33f948d --- /dev/null +++ b/future_value4/FutureValue/frmFutureValue.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FutureValue +{ + public partial class frmFutureValue : Form + { + public frmFutureValue() + { + InitializeComponent(); + } + + private void frmFutureValue_Load(object sender, EventArgs e) + { + for (int i = 1; i <= 20; ++i) + cboYears.Items.Add(i); + cboYears.SelectedIndex = 2; + } + + private void btnCalculate_Click(object sender, EventArgs e) + { + try { + if (IsValidData()) { + lstValues.Items.Clear(); + + decimal monthlyInvestment = + Convert.ToDecimal(txtMonthlyInvestment.Text); + decimal yearlyInterestRate = + Convert.ToDecimal(txtInterestRate.Text); + + int years = (int)cboYears.SelectedItem; + int months = years * 12; + decimal monthlyInterestRate = yearlyInterestRate / 12 / 100; + + for (int i = 1; i <= months; ++i) + if (i % 12 == 0) { + decimal futureValue = CalculateFutureValue( + monthlyInvestment, monthlyInterestRate, i); + lstValues.Items.Add("Year " + i/12 + ": " + + futureValue.ToString("c")); + } + } + } + catch (Exception ex) { + MessageBox.Show(ex.Message + "\n\n" + + ex.GetType().ToString() + "\n" + + ex.StackTrace, "Exception"); + } + } + + public bool IsValidData() + { + bool success = true; + string errorMessage = ""; + + // Validate the Monthly Investment text box + errorMessage += IsDecimal(txtMonthlyInvestment.Text, txtMonthlyInvestment.Tag.ToString()); + errorMessage += IsWithinRange(txtMonthlyInvestment.Text, txtMonthlyInvestment.Tag.ToString(), 1, 1000); + + // Validate the Yearly Interest Rate text box + errorMessage += IsDecimal(txtInterestRate.Text, txtInterestRate.Tag.ToString()); + errorMessage += IsWithinRange(txtInterestRate.Text, txtInterestRate.Tag.ToString(), 1, 20); + + if (errorMessage != "") { + success = false; + MessageBox.Show(errorMessage, "Entry Error"); + } + return success; + } + + public static string IsPresent(string value, string name) + { + string msg = ""; + if (value == "") { + msg += name + " is a required field.\n"; + } + return msg; + } + + public static string IsDecimal(string value, string name) + { + string msg = ""; + if (!Decimal.TryParse(value, out _)) { + msg += name + " must be a valid decimal value.\n"; + } + return msg; + } + + public static string IsInt32(string value, string name) + { + string msg = ""; + if (!Int32.TryParse(value, out _)) { + msg += name + " must be a valid integer value.\n"; + } + return msg; + } + + public static string IsWithinRange(string value, string name, decimal min, decimal max) + { + string msg = ""; + if (Decimal.TryParse(value, out decimal number)) { + if (number < min || number > max) { + msg += name + " must be between " + min + " and " + max + ".\n"; + } + } + return msg; + } + + private decimal CalculateFutureValue(decimal monthlyInvestment, + decimal interestRateMonthly, int months) + { + decimal futureValue = 0m; + for (int i = 0; i < months; i++) { + futureValue = (futureValue + monthlyInvestment) + * (1 + interestRateMonthly); + } + return futureValue; + } + + private void btnExit_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/future_value4/FutureValue/frmFutureValue.resx b/future_value4/FutureValue/frmFutureValue.resx new file mode 100644 index 0000000..b92c163 --- /dev/null +++ b/future_value4/FutureValue/frmFutureValue.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs new file mode 100644 index 0000000..3364fdf --- /dev/null +++ b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = ".NET Core 3.1")] diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfo.cs b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfo.cs new file mode 100644 index 0000000..90bed8b --- /dev/null +++ b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// 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("FutureValue")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("FutureValue")] +[assembly: System.Reflection.AssemblyTitleAttribute("FutureValue")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfoInputs.cache b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfoInputs.cache new file mode 100644 index 0000000..506a7b4 --- /dev/null +++ b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +881bbfa418ee3ef157f3620e43978e99140781aa0a25bf03046fdc6d0a9e3984 diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.GeneratedMSBuildEditorConfig.editorconfig b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..c7323b1 --- /dev/null +++ b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,11 @@ +is_global = true +build_property.ApplicationManifest = +build_property.StartupObject = +build_property.ApplicationDefaultFont = +build_property.ApplicationHighDpiMode = +build_property.ApplicationUseCompatibleTextRendering = +build_property.ApplicationVisualStyles = +build_property.RootNamespace = FutureValue +build_property.ProjectDir = C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.assets.cache b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.assets.cache new file mode 100644 index 0000000..e51eea1 Binary files /dev/null and b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.assets.cache differ diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.BuildWithSkipAnalyzers b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.BuildWithSkipAnalyzers new file mode 100644 index 0000000..e69de29 diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.CoreCompileInputs.cache b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7eb31bd --- /dev/null +++ b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +963dbe677cf428042611a9ed0c16bddc5625de9d6169866d37607c50bebad84c diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.FileListAbsolute.txt b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..45e1862 --- /dev/null +++ b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.frmFutureValue.resources +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.csproj.GenerateResource.cache +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.GeneratedMSBuildEditorConfig.editorconfig +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.AssemblyInfoInputs.cache +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.AssemblyInfo.cs +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.csproj.CoreCompileInputs.cache +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.exe +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.deps.json +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.runtimeconfig.json +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.runtimeconfig.dev.json +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.dll +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.pdb +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.dll +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.pdb +C:\Users\User\Documents\cs\Exercise Starts\Chapter 10\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.genruntimeconfig.cache diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.GenerateResource.cache b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.GenerateResource.cache new file mode 100644 index 0000000..19228b0 Binary files /dev/null and b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.GenerateResource.cache differ diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.deps.json b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.deps.json new file mode 100644 index 0000000..9bb9f82 --- /dev/null +++ b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.deps.json @@ -0,0 +1,11 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v3.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v3.1": {} + }, + "libraries": {} +} \ No newline at end of file diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.runtimeconfig.json b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.runtimeconfig.json new file mode 100644 index 0000000..fdc9c5f --- /dev/null +++ b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.runtimeconfig.json @@ -0,0 +1,16 @@ +{ + "runtimeOptions": { + "tfm": "netcoreapp3.1", + "framework": { + "name": "Microsoft.WindowsDesktop.App", + "version": "3.1.0" + }, + "additionalProbingPaths": [ + "C:\\Users\\User\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\User\\.nuget\\packages" + ], + "configProperties": { + "Microsoft.NETCore.DotNetHostPolicy.SetAppPaths": true + } + } +} \ No newline at end of file diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.dll b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.dll new file mode 100644 index 0000000..0ca0ee3 Binary files /dev/null and b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.dll differ diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.frmFutureValue.resources b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.frmFutureValue.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.frmFutureValue.resources differ diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.genruntimeconfig.cache b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.genruntimeconfig.cache new file mode 100644 index 0000000..e3e8968 --- /dev/null +++ b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.genruntimeconfig.cache @@ -0,0 +1 @@ +24629db86f4d404765b6d8f3e7aedda44a9c0b9ba5017bc9cb40dd4bf53f5503 diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.pdb b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.pdb new file mode 100644 index 0000000..02807a6 Binary files /dev/null and b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.pdb differ diff --git a/future_value4/FutureValue/obj/Debug/netcoreapp3.1/apphost.exe b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/apphost.exe new file mode 100644 index 0000000..1382b35 Binary files /dev/null and b/future_value4/FutureValue/obj/Debug/netcoreapp3.1/apphost.exe differ diff --git a/future_value4/FutureValue/obj/FutureValue.csproj.nuget.dgspec.json b/future_value4/FutureValue/obj/FutureValue.csproj.nuget.dgspec.json new file mode 100644 index 0000000..13265ab --- /dev/null +++ b/future_value4/FutureValue/obj/FutureValue.csproj.nuget.dgspec.json @@ -0,0 +1,66 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 10\\FutureValue\\FutureValue\\FutureValue.csproj": {} + }, + "projects": { + "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 10\\FutureValue\\FutureValue\\FutureValue.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 10\\FutureValue\\FutureValue\\FutureValue.csproj", + "projectName": "FutureValue", + "projectPath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 10\\FutureValue\\FutureValue\\FutureValue.csproj", + "packagesPath": "C:\\Users\\User\\.nuget\\packages\\", + "outputPath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 10\\FutureValue\\FutureValue\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\User\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "targetAlias": "netcoreapp3.1", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "targetAlias": "netcoreapp3.1", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + }, + "Microsoft.WindowsDesktop.App.WindowsForms": { + "privateAssets": "none" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/future_value4/FutureValue/obj/FutureValue.csproj.nuget.g.props b/future_value4/FutureValue/obj/FutureValue.csproj.nuget.g.props new file mode 100644 index 0000000..af28506 --- /dev/null +++ b/future_value4/FutureValue/obj/FutureValue.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\User\.nuget\packages\ + PackageReference + 6.8.0 + + + + + \ No newline at end of file diff --git a/future_value4/FutureValue/obj/FutureValue.csproj.nuget.g.targets b/future_value4/FutureValue/obj/FutureValue.csproj.nuget.g.targets new file mode 100644 index 0000000..35a7576 --- /dev/null +++ b/future_value4/FutureValue/obj/FutureValue.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/future_value4/FutureValue/obj/project.assets.json b/future_value4/FutureValue/obj/project.assets.json new file mode 100644 index 0000000..afe603e --- /dev/null +++ b/future_value4/FutureValue/obj/project.assets.json @@ -0,0 +1,71 @@ +{ + "version": 3, + "targets": { + ".NETCoreApp,Version=v3.1": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + ".NETCoreApp,Version=v3.1": [] + }, + "packageFolders": { + "C:\\Users\\User\\.nuget\\packages\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 10\\FutureValue\\FutureValue\\FutureValue.csproj", + "projectName": "FutureValue", + "projectPath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 10\\FutureValue\\FutureValue\\FutureValue.csproj", + "packagesPath": "C:\\Users\\User\\.nuget\\packages\\", + "outputPath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 10\\FutureValue\\FutureValue\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\User\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "targetAlias": "netcoreapp3.1", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "targetAlias": "netcoreapp3.1", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + }, + "Microsoft.WindowsDesktop.App.WindowsForms": { + "privateAssets": "none" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/future_value4/FutureValue/obj/project.nuget.cache b/future_value4/FutureValue/obj/project.nuget.cache new file mode 100644 index 0000000..2c73226 --- /dev/null +++ b/future_value4/FutureValue/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "0MQizF3idO31k4aTyhdQj+fElDzVEbpmQufIBT9stjfk1PTjj4SP2I6aQuEfhISL+fSDwSUI6pjfksxeAT1iJQ==", + "success": true, + "projectFilePath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 10\\FutureValue\\FutureValue\\FutureValue.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file -- cgit 1.4.1