Define Function Classes and Call Display Member Functions
- Analyze the data structure of the functions defined in the last assignment. Wrap up each function with a C# class. Define parameters as a private array of double type. In addition, define the list of
parameter names as a public static array of string type. Note that the t() is a Triangle function, g() is a Gaussian function, and b() is a Bell function. Therefore, name parameter names of each class meaningful names; e.g., Left, Peak, Right for parameters a, b, c of the TriangularFunction.
- Define a public function (method) for each class to return the function value for a given value of x. E.g., public double GetFunctionValue( double x );
- Define a constructor for each class to let user initialize the parameters.
- A ListBox object lists the type names of the implemented function classes to let user to select a
function type to dynamically create and display a function object. Alternatively, a number of RadioButton objects can serve the same functionalities. When a target type is selected, the UI controls should be updated (hide or show) for the user to specify parameter values.
- Change the code in button-click event handling function to create a function object and display its line by calling the GetFunctionValue() method of each object of function class. When a function object is new-ed, a series object is run-time added to the chart object (via its Series property). Since objects of these functions are dynamically created, how can we change their parameter values and update their line displays?
- In addition, add a new function class to deal with the following function (Sigmoidal function): sig(x a c; , )=
- Prepare a folder named as <your ID><your name>Ass02 to put your source code in it. Compress the folder of your source code into an RAR or a ZIP file and submit to COOL. Remember to add as many comments as possible in your source code.
Notes:
- Exercise the uses of the following controls (primary properties and events):
NumericalUpDown, TrackBar, ComboBox, ListBox
- Think about how to specify the title, range, and resolution of the x-axis as a class to serve for these function objects.
- Think about how to deal with the line charts (object of Series), which of them seems belong to each object of the function class.
Reviews
There are no reviews yet.