From 1f317d3eb564e463a78cd0e47f4bcf95838c60ec Mon Sep 17 00:00:00 2001 From: ​ Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: future value 2 --- .../.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 | Bin 0 -> 74344 bytes .../015871ae-5823-496f-be87-664069285d0a.vsidx | Bin 0 -> 29952 bytes future_value2/.vs/FutureValue/v17/.futdcache.v2 | Bin 0 -> 161 bytes future_value2/.vs/FutureValue/v17/.suo | Bin 0 -> 27648 bytes .../ProjectEvaluation/futurevalue.metadata.v7.bin | Bin 0 -> 171938 bytes .../ProjectEvaluation/futurevalue.projects.v7.bin | Bin 0 -> 196474 bytes future_value2/FutureValue.sln | 25 ++++ future_value2/FutureValue/FutureValue.csproj | 9 ++ future_value2/FutureValue/FutureValue.csproj.user | 8 + future_value2/FutureValue/Program.cs | 23 +++ .../bin/Debug/netcoreapp3.1/FutureValue.deps.json | 23 +++ .../bin/Debug/netcoreapp3.1/FutureValue.dll | Bin 0 -> 10240 bytes .../bin/Debug/netcoreapp3.1/FutureValue.exe | Bin 0 -> 158208 bytes .../bin/Debug/netcoreapp3.1/FutureValue.pdb | Bin 0 -> 12916 bytes .../FutureValue.runtimeconfig.dev.json | 8 + .../netcoreapp3.1/FutureValue.runtimeconfig.json | 9 ++ .../FutureValue/frmFutureValue.Designer.cs | 166 +++++++++++++++++++++ future_value2/FutureValue/frmFutureValue.cs | 128 ++++++++++++++++ future_value2/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 -> 10240 bytes .../FutureValue.frmFutureValue.resources | Bin 0 -> 180 bytes .../FutureValue.genruntimeconfig.cache | 1 + .../obj/Debug/netcoreapp3.1/FutureValue.pdb | Bin 0 -> 12916 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_value2/FutureValue/obj/project.assets.json | 71 +++++++++ future_value2/FutureValue/obj/project.nuget.cache | 8 + 40 files changed, 764 insertions(+) create mode 100644 future_value2/.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 create mode 100644 future_value2/.vs/FutureValue/FileContentIndex/015871ae-5823-496f-be87-664069285d0a.vsidx create mode 100644 future_value2/.vs/FutureValue/v17/.futdcache.v2 create mode 100644 future_value2/.vs/FutureValue/v17/.suo create mode 100644 future_value2/.vs/ProjectEvaluation/futurevalue.metadata.v7.bin create mode 100644 future_value2/.vs/ProjectEvaluation/futurevalue.projects.v7.bin create mode 100644 future_value2/FutureValue.sln create mode 100644 future_value2/FutureValue/FutureValue.csproj create mode 100644 future_value2/FutureValue/FutureValue.csproj.user create mode 100644 future_value2/FutureValue/Program.cs create mode 100644 future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.deps.json create mode 100644 future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.dll create mode 100644 future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.exe create mode 100644 future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.pdb create mode 100644 future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.dev.json create mode 100644 future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.json create mode 100644 future_value2/FutureValue/frmFutureValue.Designer.cs create mode 100644 future_value2/FutureValue/frmFutureValue.cs create mode 100644 future_value2/FutureValue/frmFutureValue.resx create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfo.cs create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfoInputs.cache create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.GeneratedMSBuildEditorConfig.editorconfig create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.assets.cache create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.BuildWithSkipAnalyzers create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.CoreCompileInputs.cache create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.FileListAbsolute.txt create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.GenerateResource.cache create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.deps.json create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.runtimeconfig.json create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.dll create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.frmFutureValue.resources create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.genruntimeconfig.cache create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.pdb create mode 100644 future_value2/FutureValue/obj/Debug/netcoreapp3.1/apphost.exe create mode 100644 future_value2/FutureValue/obj/FutureValue.csproj.nuget.dgspec.json create mode 100644 future_value2/FutureValue/obj/FutureValue.csproj.nuget.g.props create mode 100644 future_value2/FutureValue/obj/FutureValue.csproj.nuget.g.targets create mode 100644 future_value2/FutureValue/obj/project.assets.json create mode 100644 future_value2/FutureValue/obj/project.nuget.cache (limited to 'future_value2') diff --git a/future_value2/.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 b/future_value2/.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000..030dcca Binary files /dev/null and b/future_value2/.vs/FutureValue/DesignTimeBuild/.dtbcache.v2 differ diff --git a/future_value2/.vs/FutureValue/FileContentIndex/015871ae-5823-496f-be87-664069285d0a.vsidx b/future_value2/.vs/FutureValue/FileContentIndex/015871ae-5823-496f-be87-664069285d0a.vsidx new file mode 100644 index 0000000..6b7d0d9 Binary files /dev/null and b/future_value2/.vs/FutureValue/FileContentIndex/015871ae-5823-496f-be87-664069285d0a.vsidx differ diff --git a/future_value2/.vs/FutureValue/v17/.futdcache.v2 b/future_value2/.vs/FutureValue/v17/.futdcache.v2 new file mode 100644 index 0000000..1a9353b Binary files /dev/null and b/future_value2/.vs/FutureValue/v17/.futdcache.v2 differ diff --git a/future_value2/.vs/FutureValue/v17/.suo b/future_value2/.vs/FutureValue/v17/.suo new file mode 100644 index 0000000..177a034 Binary files /dev/null and b/future_value2/.vs/FutureValue/v17/.suo differ diff --git a/future_value2/.vs/ProjectEvaluation/futurevalue.metadata.v7.bin b/future_value2/.vs/ProjectEvaluation/futurevalue.metadata.v7.bin new file mode 100644 index 0000000..d4a9ff1 Binary files /dev/null and b/future_value2/.vs/ProjectEvaluation/futurevalue.metadata.v7.bin differ diff --git a/future_value2/.vs/ProjectEvaluation/futurevalue.projects.v7.bin b/future_value2/.vs/ProjectEvaluation/futurevalue.projects.v7.bin new file mode 100644 index 0000000..4d9b049 Binary files /dev/null and b/future_value2/.vs/ProjectEvaluation/futurevalue.projects.v7.bin differ diff --git a/future_value2/FutureValue.sln b/future_value2/FutureValue.sln new file mode 100644 index 0000000..b551a62 --- /dev/null +++ b/future_value2/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", "{796B5274-53EC-4019-B102-B45BD400B24F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {796B5274-53EC-4019-B102-B45BD400B24F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {796B5274-53EC-4019-B102-B45BD400B24F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {796B5274-53EC-4019-B102-B45BD400B24F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {796B5274-53EC-4019-B102-B45BD400B24F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BAD1A624-D023-4B31-A607-3A82599CCCE3} + EndGlobalSection +EndGlobal diff --git a/future_value2/FutureValue/FutureValue.csproj b/future_value2/FutureValue/FutureValue.csproj new file mode 100644 index 0000000..7b05c62 --- /dev/null +++ b/future_value2/FutureValue/FutureValue.csproj @@ -0,0 +1,9 @@ + + + + WinExe + netcoreapp3.1 + true + + + \ No newline at end of file diff --git a/future_value2/FutureValue/FutureValue.csproj.user b/future_value2/FutureValue/FutureValue.csproj.user new file mode 100644 index 0000000..5bc7468 --- /dev/null +++ b/future_value2/FutureValue/FutureValue.csproj.user @@ -0,0 +1,8 @@ + + + + + Form + + + \ No newline at end of file diff --git a/future_value2/FutureValue/Program.cs b/future_value2/FutureValue/Program.cs new file mode 100644 index 0000000..79fd42c --- /dev/null +++ b/future_value2/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_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.deps.json b/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.deps.json new file mode 100644 index 0000000..3177387 --- /dev/null +++ b/future_value2/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_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.dll b/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.dll new file mode 100644 index 0000000..9a59d22 Binary files /dev/null and b/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.dll differ diff --git a/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.exe b/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.exe new file mode 100644 index 0000000..1382b35 Binary files /dev/null and b/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.exe differ diff --git a/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.pdb b/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.pdb new file mode 100644 index 0000000..b1f00eb Binary files /dev/null and b/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.pdb differ diff --git a/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.dev.json b/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.dev.json new file mode 100644 index 0000000..214bf78 --- /dev/null +++ b/future_value2/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_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.json b/future_value2/FutureValue/bin/Debug/netcoreapp3.1/FutureValue.runtimeconfig.json new file mode 100644 index 0000000..9b3a644 --- /dev/null +++ b/future_value2/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_value2/FutureValue/frmFutureValue.Designer.cs b/future_value2/FutureValue/frmFutureValue.Designer.cs new file mode 100644 index 0000000..c8de9bf --- /dev/null +++ b/future_value2/FutureValue/frmFutureValue.Designer.cs @@ -0,0 +1,166 @@ +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() + { + this.btnExit = new System.Windows.Forms.Button(); + this.btnCalculate = new System.Windows.Forms.Button(); + this.txtYears = new System.Windows.Forms.TextBox(); + this.txtInterestRate = new System.Windows.Forms.TextBox(); + this.txtMonthlyInvestment = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.txtFutureValue = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // btnExit + // + this.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnExit.Location = new System.Drawing.Point(141, 126); + this.btnExit.Name = "btnExit"; + this.btnExit.Size = new System.Drawing.Size(75, 23); + this.btnExit.TabIndex = 19; + this.btnExit.Text = "E&xit"; + this.btnExit.Click += new System.EventHandler(this.btnExit_Click); + // + // btnCalculate + // + this.btnCalculate.Location = new System.Drawing.Point(54, 126); + this.btnCalculate.Name = "btnCalculate"; + this.btnCalculate.Size = new System.Drawing.Size(75, 23); + this.btnCalculate.TabIndex = 18; + this.btnCalculate.Text = "&Calculate"; + this.btnCalculate.Click += new System.EventHandler(this.btnCalculate_Click); + // + // txtYears + // + this.txtYears.Location = new System.Drawing.Point(132, 64); + this.txtYears.Name = "txtYears"; + this.txtYears.Size = new System.Drawing.Size(84, 20); + this.txtYears.TabIndex = 17; + // + // txtInterestRate + // + this.txtInterestRate.Location = new System.Drawing.Point(132, 37); + this.txtInterestRate.Name = "txtInterestRate"; + this.txtInterestRate.Size = new System.Drawing.Size(84, 20); + this.txtInterestRate.TabIndex = 16; + // + // txtMonthlyInvestment + // + this.txtMonthlyInvestment.Location = new System.Drawing.Point(132, 9); + this.txtMonthlyInvestment.Name = "txtMonthlyInvestment"; + this.txtMonthlyInvestment.Size = new System.Drawing.Size(84, 20); + this.txtMonthlyInvestment.TabIndex = 15; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(12, 92); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(114, 20); + this.label4.TabIndex = 13; + this.label4.Text = "Future Value:"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(12, 64); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(114, 20); + this.label3.TabIndex = 12; + this.label3.Text = "Number of Years:"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label2 + // + this.label2.Location = new System.Drawing.Point(12, 37); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(114, 20); + this.label2.TabIndex = 11; + this.label2.Text = "Yearly Interest Rate:"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label1 + // + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(114, 20); + this.label1.TabIndex = 10; + this.label1.Text = "Monthly Investment:"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtFutureValue + // + this.txtFutureValue.Location = new System.Drawing.Point(132, 93); + this.txtFutureValue.Name = "txtFutureValue"; + this.txtFutureValue.ReadOnly = true; + this.txtFutureValue.Size = new System.Drawing.Size(84, 20); + this.txtFutureValue.TabIndex = 20; + this.txtFutureValue.TabStop = false; + // + // frmFutureValue + // + this.AcceptButton = this.btnCalculate; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnExit; + this.ClientSize = new System.Drawing.Size(243, 160); + this.Controls.Add(this.txtFutureValue); + this.Controls.Add(this.btnExit); + this.Controls.Add(this.btnCalculate); + this.Controls.Add(this.txtYears); + this.Controls.Add(this.txtInterestRate); + this.Controls.Add(this.txtMonthlyInvestment); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "frmFutureValue"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Future Value"; + this.ResumeLayout(false); + this.PerformLayout(); + } + + #endregion + + private System.Windows.Forms.Button btnExit; + private System.Windows.Forms.Button btnCalculate; + private System.Windows.Forms.TextBox txtYears; + 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.TextBox txtFutureValue; + } +} + diff --git a/future_value2/FutureValue/frmFutureValue.cs b/future_value2/FutureValue/frmFutureValue.cs new file mode 100644 index 0000000..f301573 --- /dev/null +++ b/future_value2/FutureValue/frmFutureValue.cs @@ -0,0 +1,128 @@ +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 bool IsDecimal(string txt, string name) + { + if (Decimal.TryParse(txt, out _)) + return true; + MessageBox.Show(name + " must be a decimal"); + return false; + } + + private bool IsInt32(string txt, string name) + { + if (Int32.TryParse(txt, out _)) + return true; + MessageBox.Show(name + " must be an integer"); + return false; + } + + private bool IsWithinRange(string txt, string name, decimal min, decimal max) + { + if (Decimal.TryParse(txt, out decimal i)) + if (i < min || i > max) { + MessageBox.Show(name + " must be in the range of " + + min + " to " + max + "\n"); + return false; + } + return true; + } + + private bool IsValidData() + { + bool valid = true; + + if(!IsDecimal(txtMonthlyInvestment.Text, + txtMonthlyInvestment.Name)) + valid = false; + if(!IsWithinRange(txtMonthlyInvestment.Text, + txtMonthlyInvestment.Name, 0, 10000)) + valid = false; + + if(!IsDecimal(txtInterestRate.Text, + txtInterestRate.Name)) + valid = false; + if(!IsWithinRange(txtInterestRate.Text, + txtInterestRate.Name, 0, 10000)) + valid = false; + + if(!IsInt32(txtYears.Text, + txtYears.Name)) + valid = false; + if(!IsWithinRange(txtYears.Text, + txtYears.Name, 0, 10000)) + valid = false; + + return valid; + } + + private void btnCalculate_Click(object sender, EventArgs e) + { + try { + if (!IsValidData()) + return; + + decimal monthlyInvestment = Convert.ToDecimal(txtMonthlyInvestment.Text); + decimal yearlyInterestRate = Convert.ToDecimal(txtInterestRate.Text); + int years = Convert.ToInt32(txtYears.Text); + + int months = years * 12; + decimal monthlyInterestRate = yearlyInterestRate / 12 / 100; + + decimal futureValue = this.CalculateFutureValue( + monthlyInvestment, monthlyInterestRate, months); + txtFutureValue.Text = futureValue.ToString("c"); + txtMonthlyInvestment.Focus(); + + /* throw new Exception("There was an unknown error"); */ + } + /* catch (FormatException) { + MessageBox.Show("Invalid format: Try entering " + + "numbers between 1 and 9999", "Entry Error"); + } + catch (OverflowException) { + MessageBox.Show("Overflow Error: Try entering" + + "smaller numbers", "Entry Error"); + } */ + catch (Exception ex){ + MessageBox.Show(ex.Message + "\n" + + ex.GetType().ToString() + "\n" + + ex.StackTrace, "Entry Error"); + } + } + + private decimal CalculateFutureValue(decimal monthlyInvestment, + decimal monthlyInterestRate, int months) + { + decimal futureValue = 0m; + for (int i = 0; i < months; i++) + { + futureValue = (futureValue + monthlyInvestment) + * (1 + monthlyInterestRate); + } + return futureValue; + } + + private void btnExit_Click(object sender, EventArgs e) + { + this.Close(); + } + + } +} diff --git a/future_value2/FutureValue/frmFutureValue.resx b/future_value2/FutureValue/frmFutureValue.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/future_value2/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_value2/FutureValue/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs new file mode 100644 index 0000000..3364fdf --- /dev/null +++ b/future_value2/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_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfo.cs b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfo.cs new file mode 100644 index 0000000..90bed8b --- /dev/null +++ b/future_value2/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_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfoInputs.cache b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfoInputs.cache new file mode 100644 index 0000000..506a7b4 --- /dev/null +++ b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +881bbfa418ee3ef157f3620e43978e99140781aa0a25bf03046fdc6d0a9e3984 diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.GeneratedMSBuildEditorConfig.editorconfig b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..311a6dc --- /dev/null +++ b/future_value2/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 07\FutureValue\FutureValue\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.assets.cache b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.assets.cache new file mode 100644 index 0000000..f442908 Binary files /dev/null and b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.assets.cache differ diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.BuildWithSkipAnalyzers b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.BuildWithSkipAnalyzers new file mode 100644 index 0000000..e69de29 diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.CoreCompileInputs.cache b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7eb31bd --- /dev/null +++ b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +963dbe677cf428042611a9ed0c16bddc5625de9d6169866d37607c50bebad84c diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.FileListAbsolute.txt b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..ee651fe --- /dev/null +++ b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.exe +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.deps.json +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.runtimeconfig.json +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.runtimeconfig.dev.json +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.dll +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\bin\Debug\netcoreapp3.1\FutureValue.pdb +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.frmFutureValue.resources +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.csproj.GenerateResource.cache +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.GeneratedMSBuildEditorConfig.editorconfig +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.AssemblyInfoInputs.cache +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.AssemblyInfo.cs +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.csproj.CoreCompileInputs.cache +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.dll +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.pdb +C:\Users\User\Documents\cs\Exercise Starts\Chapter 07\FutureValue\FutureValue\obj\Debug\netcoreapp3.1\FutureValue.genruntimeconfig.cache diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.GenerateResource.cache b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.GenerateResource.cache new file mode 100644 index 0000000..9ea1b7b Binary files /dev/null and b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.csproj.GenerateResource.cache differ diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.deps.json b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.deps.json new file mode 100644 index 0000000..9bb9f82 --- /dev/null +++ b/future_value2/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_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.runtimeconfig.json b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.designer.runtimeconfig.json new file mode 100644 index 0000000..fdc9c5f --- /dev/null +++ b/future_value2/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_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.dll b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.dll new file mode 100644 index 0000000..9a59d22 Binary files /dev/null and b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.dll differ diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.frmFutureValue.resources b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.frmFutureValue.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.frmFutureValue.resources differ diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.genruntimeconfig.cache b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.genruntimeconfig.cache new file mode 100644 index 0000000..0474d6c --- /dev/null +++ b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.genruntimeconfig.cache @@ -0,0 +1 @@ +bb9126e96643433063f859a79603762be7fe0e20aa9da39bebcdfd38d5e8ed3a diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.pdb b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.pdb new file mode 100644 index 0000000..b1f00eb Binary files /dev/null and b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/FutureValue.pdb differ diff --git a/future_value2/FutureValue/obj/Debug/netcoreapp3.1/apphost.exe b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/apphost.exe new file mode 100644 index 0000000..1382b35 Binary files /dev/null and b/future_value2/FutureValue/obj/Debug/netcoreapp3.1/apphost.exe differ diff --git a/future_value2/FutureValue/obj/FutureValue.csproj.nuget.dgspec.json b/future_value2/FutureValue/obj/FutureValue.csproj.nuget.dgspec.json new file mode 100644 index 0000000..7065de2 --- /dev/null +++ b/future_value2/FutureValue/obj/FutureValue.csproj.nuget.dgspec.json @@ -0,0 +1,66 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 07\\FutureValue\\FutureValue\\FutureValue.csproj": {} + }, + "projects": { + "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 07\\FutureValue\\FutureValue\\FutureValue.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 07\\FutureValue\\FutureValue\\FutureValue.csproj", + "projectName": "FutureValue", + "projectPath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 07\\FutureValue\\FutureValue\\FutureValue.csproj", + "packagesPath": "C:\\Users\\User\\.nuget\\packages\\", + "outputPath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 07\\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_value2/FutureValue/obj/FutureValue.csproj.nuget.g.props b/future_value2/FutureValue/obj/FutureValue.csproj.nuget.g.props new file mode 100644 index 0000000..af28506 --- /dev/null +++ b/future_value2/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_value2/FutureValue/obj/FutureValue.csproj.nuget.g.targets b/future_value2/FutureValue/obj/FutureValue.csproj.nuget.g.targets new file mode 100644 index 0000000..35a7576 --- /dev/null +++ b/future_value2/FutureValue/obj/FutureValue.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/future_value2/FutureValue/obj/project.assets.json b/future_value2/FutureValue/obj/project.assets.json new file mode 100644 index 0000000..bbaee28 --- /dev/null +++ b/future_value2/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 07\\FutureValue\\FutureValue\\FutureValue.csproj", + "projectName": "FutureValue", + "projectPath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 07\\FutureValue\\FutureValue\\FutureValue.csproj", + "packagesPath": "C:\\Users\\User\\.nuget\\packages\\", + "outputPath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 07\\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_value2/FutureValue/obj/project.nuget.cache b/future_value2/FutureValue/obj/project.nuget.cache new file mode 100644 index 0000000..7231f6d --- /dev/null +++ b/future_value2/FutureValue/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "Z8i165Hc4HJiq3jmEHlQ1qYhJHGPLHjJNXLBsP4nqR9xXL0KO944D7TK50cyZSmiP3zQ50OzK/GMa6g9G9Ly1Q==", + "success": true, + "projectFilePath": "C:\\Users\\User\\Documents\\cs\\Exercise Starts\\Chapter 07\\FutureValue\\FutureValue\\FutureValue.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file -- cgit 1.4.1