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

Television class, which is a subclass of the ElectronicsProduct class. More...

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

Public Member Functions

 Television (String productId, String name, double price, int warrantyPeriod)
 
void extendWarranty (int months)
 
int getWarrantyPeriod ()
 
- Public Member Functions inherited from tutorial4.part2.ElectronicsProduct
 ElectronicsProduct (String productId, String name, double price)
 
void applyDiscount (int discount)
 
String getName ()
 
double getPrice ()
 
String getProductId ()
 

Private Attributes

int warrantyPeriod
 

Detailed Description

Television class, which is a subclass of the ElectronicsProduct class.

It should have an extra attribute that records it’s warranty period (in months).

Definition at line 7 of file Television.java.

Constructor & Destructor Documentation

◆ Television()

tutorial4.part2.Television.Television ( String productId,
String name,
double price,
int warrantyPeriod )
inline

Member Function Documentation

◆ extendWarranty()

void tutorial4.part2.Television.extendWarranty ( int months)
inline

Definition at line 19 of file Television.java.

19 {
20 warrantyPeriod += months;
21 }

References tutorial4.part2.Television.warrantyPeriod.

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

Here is the caller graph for this function:

◆ getWarrantyPeriod()

int tutorial4.part2.Television.getWarrantyPeriod ( )
inline

Definition at line 15 of file Television.java.

15 {
16 return warrantyPeriod;
17 }

References tutorial4.part2.Television.warrantyPeriod.

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

Here is the caller graph for this function:

Member Data Documentation

◆ warrantyPeriod

int tutorial4.part2.Television.warrantyPeriod
private

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