Work on lab4

This commit is contained in:
2022-09-13 12:36:37 -05:00
parent 913deb1082
commit 50e7440f8c
105 changed files with 894 additions and 59 deletions

View File

@@ -34,9 +34,9 @@
this.hoursWorkedTextBox = new System.Windows.Forms.TextBox();
this.hourlyPayRateTextBox = new System.Windows.Forms.TextBox();
this.grossPayLabel = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.calculateButton = new System.Windows.Forms.Button();
this.clearButton = new System.Windows.Forms.Button();
this.exitButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
@@ -87,41 +87,44 @@
this.grossPayLabel.Size = new System.Drawing.Size(113, 23);
this.grossPayLabel.TabIndex = 5;
//
// button1
// calculateButton
//
this.button1.Location = new System.Drawing.Point(7, 115);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(74, 47);
this.button1.TabIndex = 6;
this.button1.Text = "Calculate Gross Pay";
this.button1.UseVisualStyleBackColor = true;
this.calculateButton.Location = new System.Drawing.Point(7, 115);
this.calculateButton.Name = "calculateButton";
this.calculateButton.Size = new System.Drawing.Size(74, 47);
this.calculateButton.TabIndex = 6;
this.calculateButton.Text = "Calculate Gross Pay";
this.calculateButton.UseVisualStyleBackColor = true;
this.calculateButton.Click += new System.EventHandler(this.calculateButton_Click);
//
// button2
// clearButton
//
this.button2.Location = new System.Drawing.Point(87, 115);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(60, 47);
this.button2.TabIndex = 7;
this.button2.Text = "Clear";
this.button2.UseVisualStyleBackColor = true;
this.clearButton.Location = new System.Drawing.Point(87, 115);
this.clearButton.Name = "clearButton";
this.clearButton.Size = new System.Drawing.Size(60, 47);
this.clearButton.TabIndex = 7;
this.clearButton.Text = "Clear";
this.clearButton.UseVisualStyleBackColor = true;
this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
//
// button3
// exitButton
//
this.button3.Location = new System.Drawing.Point(153, 115);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(64, 47);
this.button3.TabIndex = 8;
this.button3.Text = "Exit";
this.button3.UseVisualStyleBackColor = true;
this.exitButton.Location = new System.Drawing.Point(153, 115);
this.exitButton.Name = "exitButton";
this.exitButton.Size = new System.Drawing.Size(64, 47);
this.exitButton.TabIndex = 8;
this.exitButton.Text = "Exit";
this.exitButton.UseVisualStyleBackColor = true;
this.exitButton.Click += new System.EventHandler(this.exitButton_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(232, 182);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.exitButton);
this.Controls.Add(this.clearButton);
this.Controls.Add(this.calculateButton);
this.Controls.Add(this.grossPayLabel);
this.Controls.Add(this.hourlyPayRateTextBox);
this.Controls.Add(this.hoursWorkedTextBox);
@@ -129,7 +132,7 @@
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "Form1";
this.Text = "Payroll with Overtime";
this.ResumeLayout(false);
this.PerformLayout();
@@ -143,8 +146,8 @@
private TextBox hoursWorkedTextBox;
private TextBox hourlyPayRateTextBox;
private TextBox grossPayLabel;
private Button button1;
private Button button2;
private Button button3;
private Button calculateButton;
private Button clearButton;
private Button exitButton;
}
}

View File

@@ -6,5 +6,72 @@ namespace Lab4_2_CalebFontenot
{
InitializeComponent();
}
private void calculateButton_Click(object sender, EventArgs e)
{
try
{
// Create variables
decimal hoursWorked,
hourlyPayRate,
basePay,
overtimeHours,
overtimePay,
grossPay;
// Define constants
const decimal BASE_HOURS = 40m,
OT_MULTIPLIER = 1.5m;
// Get data
hoursWorked = decimal.Parse(hoursWorkedTextBox.Text);
hourlyPayRate = decimal.Parse(hourlyPayRateTextBox.Text);
// Determine gross pay
if (hoursWorked > BASE_HOURS)
{
// Calculate the base pay (without overtime).
basePay = hourlyPayRate * BASE_HOURS;
// Calculate the number of overtime hours.
overtimeHours = hoursWorked - BASE_HOURS;
// Calculate the overtime pay.
overtimePay = overtimeHours * hourlyPayRate * OT_MULTIPLIER;
// Calculate the gross pay.
grossPay = basePay + overtimePay;
}
else
{
// Calculate the gross pay.
grossPay = hoursWorked * hourlyPayRate;
}
// Display the gross pay.
grossPayLabel.Text = grossPay.ToString("c");
}
catch (Exception ex)
{
// Display an error message.
MessageBox.Show(ex.Message);
}
}
private void clearButton_Click(object sender, EventArgs e)
{
// Clear all the labels!
hoursWorkedTextBox.Text = "";
hourlyPayRateTextBox.Text = "";
grossPayLabel.Text = "";
// Focus the hoursWorkedTextBox
hoursWorkedTextBox.Focus();
}
private void exitButton_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

View File

@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"Lab4_2_CalebFontenot/1.0.0": {
"runtime": {
"Lab4_2_CalebFontenot.dll": {}
}
}
}
},
"libraries": {
"Lab4_2_CalebFontenot/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

View File

@@ -0,0 +1,15 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "6.0.0"
}
]
}
}

View File

@@ -13,4 +13,4 @@ build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Lab4_2_CalebFontenot
build_property.ProjectDir = Z:\media\DataEXT4\Documents\ASDV C#\Lab4\Lab4_2_CalebFontenot\
build_property.ProjectDir = Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\

View File

@@ -0,0 +1 @@
fedc85685c4dfe61f8336e7be0725d66538c8d34

View File

@@ -0,0 +1,17 @@
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\bin\Debug\net6.0-windows\Lab4_2_CalebFontenot.exe
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\bin\Debug\net6.0-windows\Lab4_2_CalebFontenot.deps.json
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\bin\Debug\net6.0-windows\Lab4_2_CalebFontenot.runtimeconfig.json
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\bin\Debug\net6.0-windows\Lab4_2_CalebFontenot.dll
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\bin\Debug\net6.0-windows\Lab4_2_CalebFontenot.pdb
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.csproj.AssemblyReference.cache
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.Form1.resources
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.csproj.GenerateResource.cache
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.GeneratedMSBuildEditorConfig.editorconfig
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.AssemblyInfoInputs.cache
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.AssemblyInfo.cs
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.csproj.CoreCompileInputs.cache
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.dll
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\refint\Lab4_2_CalebFontenot.dll
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.pdb
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\Lab4_2_CalebFontenot.genruntimeconfig.cache
Z:\home\caleb\Documents\ASDV-C-Sharp\Lab4\Lab4_2_CalebFontenot\obj\Debug\net6.0-windows\ref\Lab4_2_CalebFontenot.dll

View File

@@ -13,7 +13,8 @@
],
"additionalProbingPaths": [
"C:\\Users\\caleb\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\caleb\\.nuget\\packages"
"C:\\Users\\caleb\\.nuget\\packages",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configProperties": {
"Microsoft.NETCore.DotNetHostPolicy.SetAppPaths": true

View File

@@ -0,0 +1 @@
3b52cc375df310718affa709bf62b4bcb1306311

View File

@@ -1,20 +1,24 @@
{
"format": 1,
"restore": {
"Z:\\media\\DataEXT4\\Documents\\ASDV C#\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj": {}
"Z:\\home\\caleb\\Documents\\ASDV-C-Sharp\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj": {}
},
"projects": {
"Z:\\media\\DataEXT4\\Documents\\ASDV C#\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj": {
"Z:\\home\\caleb\\Documents\\ASDV-C-Sharp\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "Z:\\media\\DataEXT4\\Documents\\ASDV C#\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"projectUniqueName": "Z:\\home\\caleb\\Documents\\ASDV-C-Sharp\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"projectName": "Lab4_2_CalebFontenot",
"projectPath": "Z:\\media\\DataEXT4\\Documents\\ASDV C#\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"projectPath": "Z:\\home\\caleb\\Documents\\ASDV-C-Sharp\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"packagesPath": "C:\\Users\\caleb\\.nuget\\packages\\",
"outputPath": "Z:\\media\\DataEXT4\\Documents\\ASDV C#\\Lab4\\Lab4_2_CalebFontenot\\obj\\",
"outputPath": "Z:\\home\\caleb\\Documents\\ASDV-C-Sharp\\Lab4\\Lab4_2_CalebFontenot\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\caleb\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [

View File

@@ -5,11 +5,12 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\caleb\.nuget\packages\</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\caleb\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.3.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\caleb\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>

View File

@@ -8,19 +8,24 @@
"net6.0-windows7.0": []
},
"packageFolders": {
"C:\\Users\\caleb\\.nuget\\packages\\": {}
"C:\\Users\\caleb\\.nuget\\packages\\": {},
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "Z:\\media\\DataEXT4\\Documents\\ASDV C#\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"projectUniqueName": "Z:\\home\\caleb\\Documents\\ASDV-C-Sharp\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"projectName": "Lab4_2_CalebFontenot",
"projectPath": "Z:\\media\\DataEXT4\\Documents\\ASDV C#\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"projectPath": "Z:\\home\\caleb\\Documents\\ASDV-C-Sharp\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"packagesPath": "C:\\Users\\caleb\\.nuget\\packages\\",
"outputPath": "Z:\\media\\DataEXT4\\Documents\\ASDV C#\\Lab4\\Lab4_2_CalebFontenot\\obj\\",
"outputPath": "Z:\\home\\caleb\\Documents\\ASDV-C-Sharp\\Lab4\\Lab4_2_CalebFontenot\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\caleb\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [

View File

@@ -1,8 +1,8 @@
{
"version": 2,
"dgSpecHash": "rFgUuhsLbFoH+AjKrlbCBUknxqB9804C7Kc19YJ7gzr7wj99MIqBO9Me00DBbDpooNKDpJmot7zNxCAT44Mbcg==",
"dgSpecHash": "ZD/TB1tjDG1pgysxbjKTee3XoZ5raHs/T4ruxZrU6KU5U1K5S31tRYOMXHT6iqKqy91Z/li/8xK26xVuCngn9A==",
"success": true,
"projectFilePath": "Z:\\media\\DataEXT4\\Documents\\ASDV C#\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"projectFilePath": "Z:\\home\\caleb\\Documents\\ASDV-C-Sharp\\Lab4\\Lab4_2_CalebFontenot\\Lab4_2_CalebFontenot.csproj",
"expectedPackageFiles": [],
"logs": []
}