Skip to content

seo-asif/Mastering-PHP-OOP-Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Mastering-PHP-OOP-Assignment

Online Shopping Cart System

In this project, I have implemented a Product class that represents a product in the online shopping cart system. The Product class has the following properties:

  • id (integer type): the unique identifier of the product.
  • name (string type): the name of the product.
  • price (float type): the price of the product.

In addition to the properties, the Product class should also have the following methods:

  1. __construct: a constructor method that takes the id, name, and price as parameters and initializes the corresponding properties of the object.

  2. getFormattedPrice: a method that returns the price of the product formatted as a string with two decimal places.

  3. showDetails: a method that prints the details of the product (id, name, and formatted price) to the console.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages