title: How to parse user input to int in console application
body: <p>I want to create a C# application that inputs one salesperson's item sold for the last week and calculates and displays that salesperson's earnings. The sales person receives $200 per week plus 9% of their gross sales for that week. Having been supplied a list of items sold by each salesperson and their values, how do I convert the user input to int? Everything else works fine.</p>
  
  <pre><code>double value1, value2, value3, value4;
  
  value1 = 239.99;
  value2 = 129.75;
  value3 = 99.95;
  value4 = 350.89;
  
  Console.Write("Enter number sold of product #1: ");
  int item1 = Convert.ToInt32(Console.ReadLine());
  
  Console.Write("Enter number sold of product #2: ");
  int item2 = Convert.ToInt32(Console.ReadLine());
  
  Console.Write("Enter number sold of product #3: ");
  int item3 = Convert.ToInt32(Console.ReadLine());
  
  Console.Write("Enter number sold of product #4: ");
  int item4 = Convert.ToInt32(Console.ReadLine());
  
  double sales1, sales2, sales3, sales4, totalSales;
  
  sales1 = item1 * value1;
  sales2 = item2 * value2;
  sales3 = item3 * value3;
  sales4 = item4 * value4;
  
  totalSales = sales1 + sales2 + sales3 + sales4;
  
  double commission;
  int weeklyPay = 200;
  
  commission = (9/100) * totalSales;
  
  double salary;
  
  salary = commission + weeklyPay;
  
  Console.Write("Earnings this week: " + salary);
  
  Console.ReadLine();
  </code></pre>