Create a new Windows Form .NET Framework App

1. In the comments of Form1.CS answer the following questions

  • What are the four pillars of object-oriented programming?
  • In your own words give a definition for each pillar. It is ok if this is not the most academic explanation, I want to know what these concepts mean to you.
  • What is the purpose of encapsulation?
  • What is the difference between method hiding and method overriding?
  • What is the difference between an abstract class and a concrete class?
  • What is an interface?
  • Describe a situation where an interface would be useful?
  • What is a generic?
  • Describe a situation where a generic would be useful?

2. You have been asked to define the OOP class structure for a sales company. The users in their system are one of the following types - Customers, Salesperson, or Admin.

3. They sell products which are one of three categories - Cars, Boats, RVs. Currently all of their products are vehicles, but this may change in the future.

4. They also need an order class which will need customer, salesperson, and a list of products. The order class should be able to call the ProcessPayment() method of the customer, passing the total cost of the List< Product > as a parameter.

5.Add a Class Library .Net Framework to the project with the following classes. Choose the data type you believe is the best fit for the fields.

The User Structure:

  • User.cs - Abstract Base Class with the following fields and properties, all other users inherit from this base class
    • _firstName
    • _lastName
    • _password
    • _email
    • _phone
    • Provide properties for get/set access to each of the fields
    • Override the ToString() method to return the properties as a string
  • Admin.cs - inherits from user
    • _level : level provides an access code that defines how much access a given admin has to the system
    • provide a Get property for level
    • Override the ToString() method to return the properties as a string
  • Customer.cs - inherits from user
    • _cardNumber : payment information
    • bool ProcessPayment(decimal price){} - method that will process a payment for the given price amount. Returns true if payment is successful/false if failed. You can simulate this process no real implementation necessary
    • Override the ToString() method to return the properties as a string
  • Salesperson.cs - inherits from user
    • _salesIdNumber : unique ID for each salesperson
    • Override the ToString() method to return the properties as a string

The product structure:

  • Product.cs Abstract Base Class with the following fields and properties
    • _productId
    • _price
    • _quantityInStock
    • _make
    • _model
    • Provide properties for get access to make/model and productid.
    • Get and Set Access for price and quantityInStock
    • Override the ToString() method to return the properties as a string
  • Vehicle Abstract class for all vehicles - inherits from product
    • _year
    • _mileage
    • Provide properties for get access to year
    • Get and Set Access for mileage
    • Override the ToString() method to return the properties as a string
  • Car.cs - inherits from vehicle
    • _type (sports car, van, suv etc)
    • Get Access for Type
    • Override the ToString() method to return the properties as a string
  • Boat.cs - inherits from vehicle
  • RV.CS - inherits from vehicle

The Order Class :

  • _completed - This is a true or false based on whether the order has been completed or not
  • Provide Get access to completed
  • An order requires a customer, a salesperson, and a List< Product >
    • Extra Credit - Create your order class in such a way that it relies exclusively on interfaces instead of concrete classes.
  • Void CompleteOrder() - This method will total up the price of the list< product > and call the ProcessPayment() method of the customer. If the transaction is successful set the _completed field to true.

Generate a class diagram for your object design.

The UI:

  • in Form1.cs create at least one Customer and Salesperson and a List< product >
  • Provide UI to be able to select a customer, a salesperson, and products
  • Provide UI to create a new order and complete the order.
  • When the order is completed save the information of the order to a file (you may choose any technique you like).
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.