GithubHelp home page GithubHelp logo

diamondmccall / factory-pattern Goto Github PK

View Code? Open in Web Editor NEW

This project forked from truecodersio/factory-pattern

0.0 0.0 0.0 100 KB

.NET 6.0 template project for the Factory Pattern exercise at TrueCoders

C# 100.00%

factory-pattern's Introduction

Complete the console app to utilize factory pattern by taking a user’s input of how many tires are on a vehicle and, based on their input, creates that type of vehicle. Complete this using an interface. You must have at least 2 subclasses. For instance, if I type 4 into the console, the program would create a car or truck, or if someone types 2 it would create a motorcycle.

Feel free to use something other than vehicles if you want to be creative, but the other constraints still apply!

  • Create an Interface named IVehicle that has a stubbed out public void Drive method.
  • Create 2 new public classes that will conform to IVehicle.
    • Example) Car, Motorcycle, BigRig

Note: These classes must conform to IVehicle and implement the Drive() method - which will just Console.WriteLine(“Building a new Car!”)

Now we will make our static VehicleFactory class. It will contain a static method GetVehicle(), that will return an IVehicle based on the amount of tires it’s given as a parameter Call this functionality in the Main method.

Possible Answer: https://github.com/mvdoyle/FactoryPattern

factory-pattern's People

Contributors

schwenk-a avatar diamondmccall avatar mvdoyle 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.