using System;
public class Employee
{
public int id;
public String name;
public float salary;
public void insert(int i, String n,float s)
{
id = i;
name = n;
salary = s;
}
public void display()
{
Console.WriteLine(id + " " + name+" "+salary);
}
}
class TestEmployee{
public static void Main(string[] args)
{
Employee e1 = new Employee();
Employee e2 = new Employee();
e1.insert(1011, "Rambo",880000f);
e2.insert(1022, "Azmi", 440000f);
e1.display();
e2.display();
}
}
1011 Rambo 880000
1022 Azmi 440000
First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.
Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.