CS411 - Visual Programming Assignment No. 01 Semester: Spring 2024 Total Marks: 20

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

CS411 – Visual Programming

Total Marks: 20
Assignment No. 01
Semester: Spring 2024 Due Date: 29-April-2024

//Put screenshot of output here

//Put your code here


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BC200417729

public class Employee

1
CS411 – Visual Programming
Total Marks: 20
Assignment No. 01
Semester: Spring 2024 Due Date: 29-April-2024

public decimal Salary { get; set; }


public string Name { get; set; }

public class Manager : Employee


{
public string Designation { get; set; }
public int Id { get; set; }

public class Program


{
public static void Main(string[] args)
{
Manager sydobj = new Manager();
sydobj.Id = 200417729;
sydobj.Salary = 1350000;
sydobj.Designation = "HR Manager";
sydobj.Name = "Syed younas danyal";

Console.WriteLine("Manager Details:\n`````````````````");
Console.WriteLine("Name: " + sydobj.Name);
Console.WriteLine("Salary: " + sydobj.Salary);
Console.WriteLine("ID: " + sydobj.Id);
Console.WriteLine("Designation: " + sydobj.Designation );
Console.ReadLine();
}
}
}

Instructions:
Please read the following instructions carefully before submitting assignment:

You need to use MS word document to prepare and submit the assignment on VU-LMS.

It should be clear that your assignment will not get any credit if:

 The assignment is submitted after due date.

2
CS411 – Visual Programming
Total Marks: 20
Assignment No. 01
Semester: Spring 2024 Due Date: 29-April-2024

 The assignment is not in the required format (doc or docx).


 The submitted assignment does not open or file is corrupt.
 Assignment is copied (partial or full) from any source (websites, forums, students,
etc)

Objectives:

The objective of this assignment is to enhance the learning capabilities of the students about:

 Introduction to Programming Language C#


 Inheritance
 Properties

If you have any confusion, you can send your query at [email protected]

Lectures Covered: 1 to 12

Problem Statement:

Imagine you're tasked with building a program in C# using Visual Studio. First, you need to define an
`Employee` class. Each employee should have a `Name` and `Salary` property.

Next, you're asked to create a more specialized class called `Manager`, which should be inherited
from the `Employee` class. Manager has additional properties: `Id` and `Designation`.

3
CS411 – Visual Programming
Total Marks: 20
Assignment No. 01
Semester: Spring 2024 Due Date: 29-April-2024

Now, it's time to put your classes into action. You need to define a `Program` class and in its `Main`
method, instantiate a `Manager` class’s object. Set all the properties for this manager instance. Once
you've set the properties, print out the details of the manager object to the console.

Note: Utilize C# language’s features for creating properties with getters and setters to define the
properties of both the `Employee` and `Manager` classes.

Instructions:
 In the Name property of Employee class, you will write your own name.
 In the Id property of Manager class, you will write the numeric part of your VU I’d like 1234567.
 If you didn’t use your own name and id, you will get zero marks.
 Paste the screen shot of output at top of solution in word document, then paste code of program.
(Solution Template is given on page No 3 of this file)

You might also like