Why can't I design simple software and classes thorugh object orinted programming in c#?

I’m a novice C# programmer and unfortunately I can’t design classes for simple software, for example, a calculator application with C#. A lot of people said to me: Just write many projects and then you will be a good programmer!!!,in fact,i wanna know that how do you think?

this is my calculation class.

  public class Calculation {     public Stack<int> StackNumber = new Stack<int>();     public Stack<string> StackString = new Stack<string>();     public int[] saveNumbers = new int[2];      private void Add(int number1, int number2)     {         StackNumber.Push(number1 + number2);     }      private void Subtract(int number1, int number2)     {         StackNumber.Push(number1 - number2);     }      private void Multipy(int number1, int number2)     {         StackNumber.Push(number1 * number2);     }      private void Divide(int number1, int number2)     {         StackNumber.Push(number1 / number2);     }      public void SeprateNumberFromOperator(string text)     {         int number;          int count = text.Length;         while (count > 0)         {             char item = Convert.ToChar(text.Substring(count - 1, 1));              if (int.TryParse(item.ToString(), out number) && item != ' ')             {                 StackNumber.Push((int)char.GetNumericValue(item));             }             else if (!int.TryParse(item.ToString(), out number) && item != ' ')             {                 StackString.Push(item.ToString());             }             count--;         }          DetectOperator();     }      private void DetectOperator()     {         int count = 0;         while (StackString.Count > 0)         {             if (count == 2)             {                 switch (StackString.Pop())                 {                     case "+":                         Add(saveNumbers[0], saveNumbers[1]);                         break;                      case "-":                         Subtract(saveNumbers[0], saveNumbers[1]);                         break;                      case "*":                         Multipy(saveNumbers[0], saveNumbers[1]);                         break;                      case "/":                         Divide(saveNumbers[0], saveNumbers[1]);                         break;                 }             }             if (count == 2)             {                 count = 0;             }             saveNumbers[count] = StackNumber.Pop();             count++;         }         if (StackString.Count == 0)         {             MessageBox.Show(saveNumbers[0].ToString());         }     } }    private void btnCall_Click(object sender, EventArgs e)     {         Calculation calc = new Calculation();          int number;         Button btn = sender as Button;         if (btn.Text == "C")         {             txtNumber.Clear();             txtNumber.Focus();         }         else if (!int.TryParse(btn.Text, out number))         {             if (btn.Text == "=")             {                 calc.SeprateNumberFromOperator(txtNumber.Text);              }             else                  txtNumber.Text += btn.Text;         }         else         {             txtNumber.Text += btn.Text;         }     } 

Replay

Category: c# Time: 2016-07-29 Views: 1
Tags: oop uml Design

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.221 (s). 12 q(s)