Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleCalculator
  8. {
  9.     public class Calculator
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double firstNumber;
  14.             double secondNumber;
  15.             double answer;
  16.  
  17.             Console.WriteLine("Hi, write a first number and press Enter");
  18.             firstNumber = Double.Parse(Console.ReadLine());
  19.            
  20.             Console.WriteLine("ok, write a second number and press Enter");
  21.             secondNumber = Double.Parse(Console.ReadLine());
  22.            
  23.             Console.WriteLine("What do you want to do with these numbers?");
  24.             Console.WriteLine("write + to add");
  25.             Console.WriteLine("write - to substract ");
  26.             Console.WriteLine("write * multiply");
  27.             Console.WriteLine("write / divide");
  28.            
  29.             switch (Console.ReadLine())
  30.             {
  31.                     case ""
  32.             }
  33.         }
  34.  
  35.         public int Add(int a, int b)
  36.         {
  37.             int score=0;
  38.             score= a + b;
  39.             return score;
  40.         }
  41.  
  42.         public int Substract(int a, int b)
  43.         {
  44.             int score=0;
  45.             score= a - b;
  46.             return score;
  47.         }
  48.  
  49.         public int Multiply(int a, int b)
  50.         {
  51.             int score=0;
  52.             score= a * b;
  53.             return score;
  54.         }
  55.  
  56.         public double Divide(int a, int b)
  57.         {
  58.             int score=0;
  59.             score= a / b;
  60.             return score;
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement