A beginner friendly breakdown of creating classes and objects in C#

What is a class?

A class is a blueprint for a data-type (data-types such as string, integer, Boolean .etc). By creating a class, you are creating your own data-type.

View the example of a class below, lets work through it.

class Box {   public double Length { get; set; }   public…

Variables

type variableName = assignedValue

int — numbers / integers without decimals

double — integers with decimals

char — single characters ‘A’ with single quotes

string — text, with double quotes:

  • string: .Length, .ToUpper, .ToLower, .Concat
  • string interpolation: don’t need to include spaces in the variable — $"My full name is…

Guess who’s back with the Anime x Coding examples!

OOP (object-oriented programming) is about creating objects that contain:

  • Data (variable defined directly in the class? => Field)
  • Methods (functions, block of code that runs only when called, can accept parameters)

OOP core concepts:

  • Encapsulation
  • Inheritance
  • Abstraction
  • Polymorphism

Methods

Methods in C# => name of method capitalised with parentheses the end. To run method…

A breakdown of how to reverse an array of numbers using a for loop in JavaScript.

For loop diagram

Lets take the array: [11, 5, 19, 98]for example. We want the reverse: [98, 19, 5, 11]

1. Define the function and parameter for the array of numbers

function reverseArrayOfNumbers(arr){

*code body*

}

2. Create an empty array

This is to store the numbers in once they’ve been reversed

let reverseArray = [];

3. Create a for loop

for (let i = arr.length — 1 ; i >=0 ; i--){

*for…

Alexa, play “Do It” by Chloe x Halle.

Most people familiar with coding know about Python, either what it is or how it works. Someone who is new and wanting to learn how to code might even consider learning Python as their first language. Here’s my take on that:

Do…

Finding a Balance between Comfort and Coding

If we weren’t in the middle of a pandemic this article would probably consist of ‘sit in your local coffee shop! Sip and relax as you code!’ with flower and sparkle emoji’s. You know the ones.

If you’re like me, my only environments…

Olivia Walker

Hi, I’m Olivia and I’m currently learning how to code. It’s challenging and fun. Join me as I blog about the highs and lows.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store