This lab requires you to use C++ class composition to implement a single pole-filter design program. The program will allow the user to specify resistor and capacitor values and filter type. Once all the user parameters are specified, the program will return the cutoff frequency values for the filter.
Composition may be thought of as a has-a relationship for objects, as compared to inheritance, which may be described as an is-a relationship for objects.
You are required to use two component classes: one for a resistor object and one for a capacitor object. You are then to define and implement a filter class that will contain one object of each the resistor and the capacitor classes in order to create the filter and its characteristics.
The Resistor class created in the Week 2 iLab may be used both as the class definition for the resistor object and as a template or a guide for the capacitor-class definition.
The lab also requires you to implement your program in a multiple-file project and create both cpp and h files for each class defined. In addition, the program will have the capacity to save all filter parameters to a text file and read previously designed filter parameters from a text file.
STEP 1: Create a Multifile Project for the Composition Lab
1. Add three classes to the project: a Filter class, a Capacitor class, and a Resistor class.
2. You may use the Resistor class files from the Week 2 lab for this lab.
3. The Capacitor class should be modeled after the Resistor class for class members and operation.
STEP 2: Filter-Class Definition
The Filter class should have, at a minimum, the following capabilities.
1. a resistor-object data member
2. a capacitor-object data member
3. a cutoff frequency (in Hertz) of the RC filter
4. maximum and minimum cutoff frequencies, based on the maximum and minimum in-tolerance values of the capacitor and the resistor object
5. a filter type, either low pass or high pass
6. allow the user to enter new values for the filter, including
6.1. resistor tolerance and nominal resistance;
6.2. capacitor tolerance and nominal capacitance; and
6.3. filter type
7. provides the ability to write all capacitor, resistor, and filter data members to a formatted text file and allows the user to name the file
8. provides the ability to read all capacitor, resistor, and filter data members from a formatted text file and allows the user to enter the file name and correctly handles a file-not-found error
STEP 3: Test-Program Operation
1. All data-input and data-display operations (cin and cout) should be done in the function main() test program.
2. The test program should instantiate at least one object of the class Filter.
a. The user should enter values for all the data members of the Filter, Resistor, and Capacitor classes.
b. The Filter class should then calculate and display the correct maximum and minimum cutoff frequencies.
3. The test program should then display all Filter, Resistor, and Capacitor data members.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at [email protected] and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at [email protected].
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.