COMP2396
Loading...
Searching...
No Matches
tutorial4.part2.ElectronicsProduct Class Reference

ElectronicsProduct class with attributes for product ID, name, and price. More...

Inheritance diagram for tutorial4.part2.ElectronicsProduct:
Collaboration diagram for tutorial4.part2.ElectronicsProduct:

Public Member Functions

 ElectronicsProduct (String productId, String name, double price)
 
void applyDiscount (int discount)
 
String getName ()
 
double getPrice ()
 
String getProductId ()
 

Private Attributes

final String name
 
double price
 
final String productId
 

Detailed Description

ElectronicsProduct class with attributes for product ID, name, and price.

Definition at line 6 of file ElectronicsProduct.java.

Constructor & Destructor Documentation

◆ ElectronicsProduct()

tutorial4.part2.ElectronicsProduct.ElectronicsProduct ( String productId,
String name,
double price )
inline

Member Function Documentation

◆ applyDiscount()

void tutorial4.part2.ElectronicsProduct.applyDiscount ( int discount)
inline

Definition at line 17 of file ElectronicsProduct.java.

17 {
18 price = price * (100 - discount) / 100;
19 }

References tutorial4.part2.ElectronicsProduct.price.

Referenced by tutorial4.part2.Tester.main().

Here is the caller graph for this function:

◆ getName()

String tutorial4.part2.ElectronicsProduct.getName ( )
inline

Definition at line 25 of file ElectronicsProduct.java.

25 {
26 return name;
27 }

References tutorial4.part2.ElectronicsProduct.name.

Referenced by tutorial4.part2.Tester.main().

Here is the caller graph for this function:

◆ getPrice()

double tutorial4.part2.ElectronicsProduct.getPrice ( )
inline

Definition at line 29 of file ElectronicsProduct.java.

29 {
30 return price;
31 }

References tutorial4.part2.ElectronicsProduct.price.

Referenced by tutorial4.part2.Tester.main().

Here is the caller graph for this function:

◆ getProductId()

String tutorial4.part2.ElectronicsProduct.getProductId ( )
inline

Definition at line 21 of file ElectronicsProduct.java.

21 {
22 return productId;
23 }

References tutorial4.part2.ElectronicsProduct.productId.

Referenced by tutorial4.part2.Tester.main().

Here is the caller graph for this function:

Member Data Documentation

◆ name

final String tutorial4.part2.ElectronicsProduct.name
private

◆ price

◆ productId

final String tutorial4.part2.ElectronicsProduct.productId
private

The documentation for this class was generated from the following file: