C# arrays 🚗

Поділитися
Вставка
  • Опубліковано 18 лис 2024

КОМЕНТАРІ • 37

  • @BroCodez
    @BroCodez  3 роки тому +40

    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 Рік тому +11

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

  • @abraham.hayden
    @abraham.hayden Годину тому +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

  • @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?

  • @Nathan-KyneBolla
    @Nathan-KyneBolla 2 місяці тому +1

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

  • @elliotradley4370
    @elliotradley4370 2 роки тому +5

    The late night coding sessions is what I live for

  • @sithijadealwis1033
    @sithijadealwis1033 Рік тому +1

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

  • @allashama
    @allashama 2 роки тому +6

    my brain has blowed up lol

    • @BroCodez
      @BroCodez  2 роки тому +10

      That means it's working

  • @MsKillaDJ
    @MsKillaDJ Рік тому

    Thanks this made everything click

  • @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).

  • @repairstudio4940
    @repairstudio4940 8 місяців тому

    Great vid!🎉

  • @user-gk9fn8pu1f
    @user-gk9fn8pu1f Рік тому

    top

  • @Ronnyxxedit
    @Ronnyxxedit 9 місяців тому

    Thank you ❤

  • @samer_is_code_it_now
    @samer_is_code_it_now 11 місяців тому

    thank u man

  • @spartanranger
    @spartanranger 3 роки тому

    Thanks for the video Bro.

  • @julox7938
    @julox7938 2 роки тому +4

    SOS GOD FLACO

  • @zacksc2574
    @zacksc2574 Рік тому +1

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

  • @ryan7362
    @ryan7362 Рік тому +1

    I got an exam tomorrow thanks dude hahah

  • @ahmedhassan5783
    @ahmedhassan5783 Рік тому

    done

  •  3 роки тому

    Thanks Bro!

  • @budderrar5751
    @budderrar5751 Рік тому

    noice

  • @AKLINA-m1o
    @AKLINA-m1o 2 місяці тому

    how can i to create array with unknown size ?

  • @chinmayk2657
    @chinmayk2657 25 днів тому

    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?/

  • @simik4830
    @simik4830 Місяць тому

    for algorithm!

  • @AbdullahGameDev
    @AbdullahGameDev Рік тому

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

  • @whitedinamo
    @whitedinamo 2 роки тому

    lesson check😇