Design and implement a base class Bands in your program. The Bands class contains information of colour codes. From the base class, derived three other classes, one for each of the component described above (Resistor, Inductor, and PTC). Resistor class will contain the number of bands, tolerance, and unit of measurement (Ohms, kilo-Ohms, mega-Ohms). Inductor class will contain the fixed number of bands (4), tolerance, and unit of measurement (only in micro-Henry). PTC class will contain the number of bands, temperature coefficient (only at 0.3% per degree Celsius), types (two types are available), and unit of measurement (only in kilo-Ohms).
Example of user entries are as follows (user entry in bold, computed result in italic and bold):
Component type: R
Number of Bands <3/4>: 4
Colour bands (separated by spaces): Green Green Red
Tolerance: Silver
Value of the RESISTOR is: 5.5 kilo-Ohms, 10% tolerance
You are required to exercise creativity and object oriented approach in your program design and may add other features; you should also make your program as friendly as possible to the users.
Example of user entries are as follows (user entry in bold, computed result in italic and bold):
Component type: R
Number of Bands <3/4>: 4
Colour bands (separated by spaces): Green Green Red
Tolerance: Silver
Value of the RESISTOR is: 5.5 kilo-Ohms, 10% tolerance
You are required to exercise creativity and object oriented approach in your program design and may add other features; you should also make your program as friendly as possible to the users.
Comment