Building a Calculator | C# | Tutorial 9

Поделиться
HTML-код
  • Опубликовано: 8 фев 2025
  • Source Code - www.giraffeaca... .com/programming-languages/csharp/
    This video is one in a series of videos where we'll be looking at programming in C#. The course is designed for new programmers, and will introduce common programming topics using the C# language.
    Throughout the course we'll be looking at various topics including variables, arrays, getting user input, loops, conditionals, object orientation and much more.
    If you’re enjoying Giraffe Academy and want to invest in our future, consider leaving a contribution giraffeacademy...

Комментарии • 37

  • @RadiationHazard
    @RadiationHazard 5 лет назад +18

    You are the best teacher C# I have ever seen. Thank you very much!!!

    • @fathimhiri5926
      @fathimhiri5926 4 года назад

      hi, can you help me and suggest me what i can see after this playist. thank you

    • @gaius6187
      @gaius6187 3 года назад

      @@fathimhiri5926 How to make a Jew Generator In C#

    • @heavysaber9431
      @heavysaber9431 3 года назад

      @@gaius6187 you need to study about stochastic human growth algorithm and pseudo-human artificial intelligence. After that create a human class with the usual properties and methods including the AI, then make a sub-class called Jews, then make and define a special method called unparalleledReligionDrivenStudyOfTheUnknown() or something of the like. Finally, create a method called generateJews() with the knowledge of human growth algorithm and exponential growth, and you will have a functioning Jewish society.

    • @gaius6187
      @gaius6187 3 года назад

      @@heavysaber9431 what if i want to give them train tickets, and later free showers

  • @Dooxter.
    @Dooxter. 3 года назад +2

    Man this is the first thing i did after watching one video on how to code and you explained it so well and it worked first go!

  • @AhsanHabibNadeem
    @AhsanHabibNadeem 2 года назад

    hi mike dane i am getting more knowledge in your best tutorials about C# thanks dear

  • @angelzash88
    @angelzash88 7 месяцев назад

    You are amazing !!!

  • @eggman3661
    @eggman3661 2 года назад

    thanks mike im learning game development on unity and unity is c# so this is very usefull

  • @taxidev
    @taxidev 2 года назад

    Hey thank you so much! It is understantable and simple!

  • @lepre4720
    @lepre4720 4 года назад

    Thanks Mike!

  • @rubenlyon3927
    @rubenlyon3927 4 года назад

    This is the best thx man

  • @arteinterativa
    @arteinterativa 5 лет назад +1

    AMAZING DUDE! BRAZIL!!!

  • @mirkx7382
    @mirkx7382 Год назад

    i want to add evaluating functiionality and () bracket buttons in my calculator ? how can i do that?

  • @fooballers7883
    @fooballers7883 Год назад

    Great tutorial...thanks

  • @elainishri5026
    @elainishri5026 5 лет назад

    thank u

  • @MakeTaijitsuGreatAgain
    @MakeTaijitsuGreatAgain 5 месяцев назад

    Why int32? What does the 32 mean ?

  • @khojiakbarkhonisakov7785
    @khojiakbarkhonisakov7785 4 года назад

    Cool

  • @inuraedirisinghe9559
    @inuraedirisinghe9559 4 года назад

    #Mike h8w to make a Calculator using Visual studio Code but not Visual Studio? Pls reply!!

    • @unlxck3255
      @unlxck3255 3 года назад

      The code is the same

  • @jarell2805
    @jarell2805 3 года назад

    how to add an error message when the user tries to enter decimal values in c#?

    • @b33bo93
      @b33bo93 3 года назад

      if (number % 1 == 0)
      {
      Console.WriteLine("Error message ");
      }

  • @onedadev
    @onedadev 4 года назад +1

    When I sum 3.6 + 2 it gives me a 38 result, why is that?

    • @thoughtlessanimations8895
      @thoughtlessanimations8895 4 года назад

      Have you solved it? If not then reply to this comment with your code and I'll see if I can find the problem

    • @onedadev
      @onedadev 4 года назад +1

      @@thoughtlessanimations8895 dude I dont have the code anymore, but I used string replacement to replace the "." with "," before making the calcs so it worked

    • @brojustplay1097
      @brojustplay1097 3 года назад

      @@onedadev yeah it cant be a point

  • @my_studies2888
    @my_studies2888 4 года назад

    Do u have to use toint32, like does there have to be the byte number after the toint?

    • @venomglitches3991
      @venomglitches3991 4 года назад

      yes, its either toint32 or 64
      my teacher said its better to use 32 if you don't really need to use 64 to prevent lag.

  • @ryad0013
    @ryad0013 4 года назад

    when i tried to work with decimal number
    it doesn't work for me
    when i enter a decimal number into the console and click enter it says FormatException was unhandled
    this is my code :
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace ConsoleApplication1
    {
    class Program
    {
    static void Main(string[] args)
    {
    Console.Write("Enter a number :");
    decimal num1 = Convert.ToDecimal(Console.ReadLine());
    Console.Write("Enter another number :");
    decimal num2 = Convert.ToDecimal(Console.ReadLine());
    Console.WriteLine(num1 + num2);


    Console.ReadLine();

    }
    }
    }

    • @ryad0013
      @ryad0013 4 года назад

      @ToM4tto yes, i am sure of that

    • @scottisitt
      @scottisitt 4 года назад

      I wasn't able to get decimal to work, either (on one of Mike's prior tutorials). int and double worked, but not decimal. ...But actually, I just tried double and decimal here, and they worked fine. 🤔

    • @MyFuturemusic
      @MyFuturemusic 4 года назад

      @ToM4tto Hey mate! you need to use a comma instead of a dot in some cases in c# i'v tried figuring out why that is for some but not some others since dot is the most normal thing to use in programminglanguages.
      you can get it fixed by doing some other coding before, but gives more headache then joy.
      so, use a comma ,

  • @brojustplay1097
    @brojustplay1097 3 года назад

    Hey, great vid, for some reason it didn't work but still ty

  • @AnimeRPG1
    @AnimeRPG1 4 года назад

    When I'm watching a video and I'm like:
    How do I get the user to also type the symbol?
    Me: Perhaps an if statement...googles if statement.
    Creates a very basic Calculator!
    Console.Write("Enter a Whole number ");
    int num1 = Convert.ToInt32(Console.ReadLine() ); //Convert string value from ReadLine to an integer.
    Console.Write("Enter another Whole number ");
    int num2 = Convert.ToInt32(Console.ReadLine());
    Console.Write("Enter a symbol (+, -, /, *) no cammas: ");
    string mathSym = Console.ReadLine(); //Store user math symbol as string
    if (mathSym == "+") //Match user math symbol to string & execute.
    {
    Console.WriteLine(num1 + num2);
    Console.ReadLine();
    return; //Exit program
    }
    else if (mathSym == "-")
    {
    Console.WriteLine(num1 - num2);
    Console.ReadLine();
    return;
    }
    else if (mathSym == "*")
    {
    Console.WriteLine(num1 * num2);
    Console.ReadLine();
    return;
    }
    else if (mathSym == "/")
    {
    Console.WriteLine(num1 / num2);
    Console.ReadLine();
    return;
    }
    else
    {
    return;
    }
    Console.ReadLine();

    • @AnimeRPG1
      @AnimeRPG1 3 года назад

      @EpicDev Thanks, I'll check into it.