OOP Examples in C# Programming Language. Create a class Student which contains basic data about the student that takes basic student information from the user and display it by using display method, an option of update is being provided to the user if he/she wants to update the data, the required data is being updated.
Source Code1:
Output1:
OBJECTIVE2:
Create a class “Computer” which contains specifications of a computer, the Source Code shall ask the user does he/she wants to open the system, if the user press “yes” then the system starts shown the initial loading and then displays the basic configuration of the system (by calling the method of display() ). Update option is being provided by the user, values of the specified items are being updated once user decides to update that item.
Source Code2:
Output2:
OBJECTIVE3;
Create a class of Employee which contains basic information about an employee, employee name, father’s name and salary etc are being displayed by the display method and the salary of the employees or the designation of the employees are being set/updated as per needs.
Source Code3:
Output3:
OBJECTIVE4;
Create a class of Automobile which contains specifications of a car, check whether the car is in “ON / Start” state if not then asks the user if he / she want to start the car. If the car is already in start state then first display the current status of the car which includes the horse power, color, made, engine type etc, providing an option to the user if he / she wants to update any of the mentioned part from the car, if user selects “YES” then it is updated according to the needs of the user, else the Source Code will be ended.
Source Code4:
Output4: