Giter Club home page Giter Club logo

csharp-quiz's Introduction

C# QUIZ

IMPORTANT: Do not use Visual Studio to answer the coding questions.

  • What is an interface?

  • What is polymorphism? Describe an example?

  • What is the difference between a class and an object?

  • What are the four pillars of OOP?

  • What is an abstract class?

  • What is the difference between an abstract class and an interface?

  • TRUE or FALSE: an abstract class can be instantiated?

  • TRUE or FALSE: an abstract class can have a constructor?

  • Is a string a value type or a reference type?

  • What is the package management system used in Visual Studio?

  • After the following method executes and is completed what will be the value of the Name property of the Employee parameter object?


public static void UpdateEmployee(Employee employee)
{
    employee.Name = "Harry Potter";
}

  • Will the Employee parameter object in the following method become null after the method executes and is completed? Why or why not?

public static void NullEmployee(Employee employee)
{
    employee = null;
}

  • In the Employee.cs file in this folder, create a class named Employee with the properties to hold the following info:

    • first name
    • last name
    • hire date
    • email
  • In the Program.cs file in this folder, create an Employee object from the class defined above. Give this object the following information:

  • Take the Employee class created from the previous example and override the ToString() method to return a string representation of the properties. Use string interpolation.

  • Create a static method on the Employee class named CloneEmployee that takes an Employee object as a parameter and returns a deep copy. Demonstrate using this method in the Program.cs file in this folder.

  • Create a method on the Employee class that returns the number of days an employee has been employed. Demonstrate using this method in the Program.cs file in this folder.

  • In the Program.cs file in this folder, create a list of Employee objects. Add three Employee objects to the list. Iterate over the list of objects and call each object's ToString() method on each iteration.

csharp-quiz's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.