Data Structures

gelee2169
ConsoleErrorHandling.zip

ConsoleErrorHandling/.vs/ConsoleErrorHandling/v14/.suo

ConsoleErrorHandling/ConsoleErrorHandling.sln

Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleErrorHandling", "ConsoleErrorHandling\ConsoleErrorHandling.csproj", "{469EAB51-E4E7-4748-B5A7-5CCC13E84F7F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {469EAB51-E4E7-4748-B5A7-5CCC13E84F7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {469EAB51-E4E7-4748-B5A7-5CCC13E84F7F}.Debug|Any CPU.Build.0 = Debug|Any CPU {469EAB51-E4E7-4748-B5A7-5CCC13E84F7F}.Release|Any CPU.ActiveCfg = Release|Any CPU {469EAB51-E4E7-4748-B5A7-5CCC13E84F7F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal

ConsoleErrorHandling/ConsoleErrorHandling/App.config

ConsoleErrorHandling/ConsoleErrorHandling/bin/Debug/ConsoleErrorHandling.exe

ConsoleErrorHandling/ConsoleErrorHandling/bin/Debug/ConsoleErrorHandling.exe.config

ConsoleErrorHandling/ConsoleErrorHandling/bin/Debug/ConsoleErrorHandling.pdb

ConsoleErrorHandling/ConsoleErrorHandling/bin/Debug/ConsoleErrorHandling.vshost.exe

ConsoleErrorHandling/ConsoleErrorHandling/bin/Debug/ConsoleErrorHandling.vshost.exe.config

ConsoleErrorHandling/ConsoleErrorHandling/bin/Debug/ConsoleErrorHandling.vshost.exe.manifest

ConsoleErrorHandling/ConsoleErrorHandling/ConsoleErrorHandling.csproj

Debug AnyCPU {469EAB51-E4E7-4748-B5A7-5CCC13E84F7F} Exe Properties ConsoleErrorHandling ConsoleErrorHandling v4.5.2 512 true AnyCPU true full false bin\Debug\ DEBUG;TRACE prompt 4 AnyCPU pdbonly true bin\Release\ TRACE prompt 4

ConsoleErrorHandling/ConsoleErrorHandling/obj/Debug/ConsoleErrorHandling.csproj.FileListAbsolute.txt

C:\Users\Bett\Desktop\HomeWork Market\c#\ConsoleErrorHandling\ConsoleErrorHandling\bin\Debug\ConsoleErrorHandling.exe.config C:\Users\Bett\Desktop\HomeWork Market\c#\ConsoleErrorHandling\ConsoleErrorHandling\bin\Debug\ConsoleErrorHandling.exe C:\Users\Bett\Desktop\HomeWork Market\c#\ConsoleErrorHandling\ConsoleErrorHandling\bin\Debug\ConsoleErrorHandling.pdb C:\Users\Bett\Desktop\HomeWork Market\c#\ConsoleErrorHandling\ConsoleErrorHandling\obj\Debug\ConsoleErrorHandling.csprojResolveAssemblyReference.cache C:\Users\Bett\Desktop\HomeWork Market\c#\ConsoleErrorHandling\ConsoleErrorHandling\obj\Debug\ConsoleErrorHandling.exe C:\Users\Bett\Desktop\HomeWork Market\c#\ConsoleErrorHandling\ConsoleErrorHandling\obj\Debug\ConsoleErrorHandling.pdb

ConsoleErrorHandling/ConsoleErrorHandling/obj/Debug/ConsoleErrorHandling.csprojResolveAssemblyReference.cache

ConsoleErrorHandling/ConsoleErrorHandling/obj/Debug/ConsoleErrorHandling.exe

ConsoleErrorHandling/ConsoleErrorHandling/obj/Debug/ConsoleErrorHandling.pdb

ConsoleErrorHandling/ConsoleErrorHandling/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache

ConsoleErrorHandling/ConsoleErrorHandling/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

ConsoleErrorHandling/ConsoleErrorHandling/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

ConsoleErrorHandling/ConsoleErrorHandling/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

ConsoleErrorHandling/ConsoleErrorHandling/Program.cs

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleErrorHandling { class employee { public string employeeType; public employee(string employeeType) { this.employeeType = employeeType; } } class Program { static void Main(string[] args) { // declare variables with their types string coName, welcomeMsg; int year; double taxrate = 0.07; //create arrays to store data from inputs string[] developers = new string[3]; string[] type = new string[3]; int[] zipcodes = new int[3]; double[] grosspay = new double[3]; double[] taxpaid = new double[3]; //input company details Console.Write("Enter the Company Name: "); coName = Console.ReadLine(); while (true) { try { Console.Write("Enter the Year the Company was formed: "); year = Convert.ToInt32(Console.ReadLine()); break; } catch (Exception) { continue; } } welcomeMsg = "Welcome we are professional Csharp developers"; //create a loop to take in all the names, zipcodes and grosspay for (int i = 0; i < 3; i++) { Console.Write("\nEnter the {0} software developer's name: ", i + 1); developers[i] = Console.ReadLine(); Console.Write("\nChoose Employee Type:\n\t1. W2\n\t2. 1099\n"); while (true) { try { Console.Write("Type: "); int choice = Convert.ToInt32(Console.ReadLine()); employee employeeType; if (choice == 1) { employeeType = new employee("W2"); } else if(choice == 2) { employeeType = new employee("1099"); } else { continue; } type[i] = employeeType.employeeType; break; } catch (Exception) { continue; } } while (true) { try { Console.Write("Enter the ZIP Code: "); zipcodes[i] = Convert.ToInt32(Console.ReadLine()); break; } catch (Exception) { continue; } } while (true) { try { Console.Write("Enter the monthly gross pay: "); grosspay[i] = Convert.ToDouble(Console.ReadLine()); break; } catch (Exception) { continue; } } if (type[i] == "W2") { taxpaid[i] = taxrate * grosspay[i]; } else { taxpaid[i] = 0; } } Console.WriteLine("\n************************************************************"); /* * Output the details * Use tabs (/t) and line breaks (/n) to align them on console screen. */ Console.WriteLine("\n\t\t\t{0}\n\t{1}\n\t\t\tSince {2}\n\n", coName, welcomeMsg, year); //loop through the arrays to show each output for (int i = 0; i < 3; i++) { Console.WriteLine("Software developer's name:\t{0}\nZIP code:\t\t\t{1}\nMonthly gross pay:\t\t{2}\nMonthly Taxes:\t\t\t{3}\nAnnual GrossPay:\t\t{4}\nAnnual Taxes:\t\t\t{5}\nNet Pay:\t\t\t{6}\n\n", developers[i], zipcodes[i], grosspay[i].ToString("C2"), taxpaid[i].ToString("C2"),(grosspay[i]*12).ToString("C2"), (taxpaid[i]*12).ToString("C2"),(grosspay[i]+taxpaid[i]).ToString("C2")); } Console.WriteLine("\n************************************************************"); /* Exit the console only when a key is pressed */ Console.ReadKey(); } } }

ConsoleErrorHandling/ConsoleErrorHandling/Properties/AssemblyInfo.cs

using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ConsoleErrorHandling")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ConsoleErrorHandling")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("469eab51-e4e7-4748-b5a7-5ccc13e84f7f")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]