Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleCalculator
- {
- public class Calculator
- {
- static void Main(string[] args)
- {
- double firstNumber;
- double secondNumber;
- double answer;
- Console.WriteLine("Hi, write a first number and press Enter");
- firstNumber = Double.Parse(Console.ReadLine());
- Console.WriteLine("ok, write a second number and press Enter");
- secondNumber = Double.Parse(Console.ReadLine());
- Console.WriteLine("What do you want to do with these numbers?");
- Console.WriteLine("write + to add");
- Console.WriteLine("write - to substract ");
- Console.WriteLine("write * multiply");
- Console.WriteLine("write / divide");
- switch (Console.ReadLine())
- {
- case ""
- }
- }
- public int Add(int a, int b)
- {
- int score=0;
- score= a + b;
- return score;
- }
- public int Substract(int a, int b)
- {
- int score=0;
- score= a - b;
- return score;
- }
- public int Multiply(int a, int b)
- {
- int score=0;
- score= a * b;
- return score;
- }
- public double Divide(int a, int b)
- {
- int score=0;
- score= a / b;
- return score;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement