C# arrays 🚗

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

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

  • @BroCodez
    @BroCodez  3 года назад +41

    using System;
    namespace MyFirstProgram
    {
    class Program
    {
    static void Main(string[] args)
    {
    // array = a variable that can store multiple values. fixed size
    //String[] cars = {"BMW", "Mustang", "Corvette"};
    String[] cars = new string[3];
    cars[0] = "Tesla";
    cars[1] = "Mustang";
    cars[2] = "Corvette";
    for (int i = 0; i < cars.Length; i++)
    {
    Console.WriteLine(cars[i]);
    }
    Console.ReadKey();
    }
    }
    }

    • @officialmoai3107
      @officialmoai3107 9 месяцев назад

      Thank you, Sir!

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

      string[] themaRondes = { "Sport", "Cultuur", "Politiek" };
      int aantalTeams = 4;
      string[] teamNamen = new string[aantalTeams];
      int[,] scores = new int[aantalTeams, themaRondes.Length];
      // Namen en scores invoeren
      for (int i = 0; i < aantalTeams; i++)
      {
      Console.Write($"Voer de naam in van team {i + 1}: ");
      teamNamen[i] = Console.ReadLine();
      for (int j = 0; j < themaRondes.Length; j++)
      {
      Console.Write($"{teamNamen[i]}, {themaRondes[j]} score: ");
      scores[i, j] = int.Parse(Console.ReadLine());
      }
      }
      // Winnaars per ronde bepalen
      for (int j = 0; j < themaRondes.Length; j++)
      {
      int hoogsteScore = -1;
      string winnaar = "";
      for (int i = 0; i < aantalTeams; i++)
      {
      if (scores[i, j] > hoogsteScore)
      {
      hoogsteScore = scores[i, j];
      winnaar = teamNamen[i];
      }
      }
      Console.WriteLine($"
      Winnaar van de {themaRondes[j]} ronde is: {winnaar} met {hoogsteScore} punten.");
      }

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

      @@officialmoai3107 // Thema's en teams
      string[] themaRondes = { "Sport", "Cultuur", "Politiek" };
      int aantalTeams = 4;
      string[] teamNamen = new string[aantalTeams];
      int[,] scores = new int[aantalTeams, themaRondes.Length];
      // Namen en scores invoeren
      for (int i = 0; i < aantalTeams; i++)
      {
      Console.Write($"Voer de naam in van team {i + 1}: ");
      teamNamen[i] = Console.ReadLine();
      for (int j = 0; j < themaRondes.Length; j++)
      {
      Console.Write($"{teamNamen[i]}, {themaRondes[j]} score: ");
      scores[i, j] = int.Parse(Console.ReadLine());
      }
      }
      // Winnaars per ronde bepalen
      for (int j = 0; j < themaRondes.Length; j++)
      {
      int hoogsteScore = -1;
      string winnaar = "";
      for (int i = 0; i < aantalTeams; i++)
      {
      if (scores[i, j] > hoogsteScore)
      {
      hoogsteScore = scores[i, j];
      winnaar = teamNamen[i];
      }
      }
      Console.WriteLine($"
      Winnaar van de {themaRondes[j]} ronde is: {winnaar} met {hoogsteScore} punten.");
      }

  • @takundasm
    @takundasm 2 года назад +21

    The comparison to variables made this so much easier to understand. Thank you for simplifying this so much.

  • @MoodyHL
    @MoodyHL Год назад +12

    Bro code is an absolute legend bro. Explaining stuff way better than my profs in college.

  • @abraham.hayden
    @abraham.hayden 11 дней назад +1

    🐐 makes its so much easier, especially explaining how it holds multiple values

  • @javidwaldron8377
    @javidwaldron8377 9 месяцев назад

    Dont usually go out of my way to comment but you are a blessing man, taking a coding class for grad school and youre helping me feel like im not gonna fail. best easy to understand quick tutorials

  • @FeenickzVR
    @FeenickzVR 9 месяцев назад

    I know a bit of java, but since Im wanting to become a game dev, these tutorials have been helping me learn a lot of the classes used in C# since I already know the syntax

  • @elliotradley4370
    @elliotradley4370 2 года назад +6

    The late night coding sessions is what I live for

  • @Nathan-KyneBolla
    @Nathan-KyneBolla 2 месяца назад +1

    Bro my dad forces me to learn c# and you made it so simple to learn.

  • @sithijadealwis1033
    @sithijadealwis1033 Год назад +1

    Ahh, I love the bass sound when you are typing! ASMR Coding!

  • @christopherdevoto7291
    @christopherdevoto7291 Год назад +2

    Honestly, Thank you so much for this. You simplified this subject matter to a point where I can comprehend the need for an array. How could we support you; do you have a bootcamp or anyway I can donate to you?

  • @Tendity
    @Tendity Месяц назад +1

    whats the difference between:
    string[] arr = {"foo", "bar"};
    string[] arr = new string[2];
    arr[1] = "foo";
    arr[2] = "bar";

    • @011_mech_anithkesava.m.r2
      @011_mech_anithkesava.m.r2 Месяц назад

      Num1: string[] arr={"foo" ,"bar"}
      -> which represents that you declare a array with string datatype and gives the array a values(Initialization) in the same line without set any total number of individual values that must be present inside the array.
      Num2:
      string[] arr=new string[2];
      arr[1]="foo";
      arr[2]="bar";
      -> which represents that you declare a array with datatype string and set the number of individual string values must be present inside is 2 and declare the value for the array of index[1] ="foo" and index[2]="bar".(That must be index[0] and [1] because index starts from 0).

  • @allashama
    @allashama 2 года назад +6

    my brain has blowed up lol

    • @BroCodez
      @BroCodez  2 года назад +10

      That means it's working

  • @user-gk9fn8pu1f
    @user-gk9fn8pu1f Год назад

    top

  • @zacksc2574
    @zacksc2574 Год назад +1

    How long did it take you to be the amazing at coding ?

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

    Thanks this made everything click

  • @repairstudio4940
    @repairstudio4940 9 месяцев назад

    Great vid!🎉

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

    done

  • @julox7938
    @julox7938 2 года назад +4

    SOS GOD FLACO

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

    Thanks for the video Bro.

  • @Ronnyxxedit
    @Ronnyxxedit 9 месяцев назад

    Thank you ❤

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

    noice

  • @ryan7362
    @ryan7362 Год назад +1

    I got an exam tomorrow thanks dude hahah

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

    thank u man

  • @AKLINA-m1o
    @AKLINA-m1o 3 месяца назад

    how can i to create array with unknown size ?

  • @chinmayk2657
    @chinmayk2657 Месяц назад

    what if user want to select random car and pass it in another class(program)
    exampl driver.findelement(By.Xpath("").sendkeys("cars");
    can you please reply?/

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

    So there is no Array in the stack in C#. Is everything in a heap?

  • @simik4830
    @simik4830 Месяц назад

    for algorithm!

  •  3 года назад

    Thanks Bro!

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

    lesson check😇