Search⌘ K

Exercise 2: Students Average Marks

Explore how to design a C# class representing student marks with private fields, access methods to get individual marks, and a function to calculate the average. Understand constructors for initializing class data through this practical exercise.

We'll cover the following...

Problem Statement

Write a C# class called student with

  • private member variables:

    • mark1 of type float
  • mark2 ...