Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How would I code this in c# Problem: In this lab you will create a graphing program that will allow a user to graph a

How would I code this in c#
Problem:
In this lab you will create a graphing program that will allow a user to graph a parabola by entering the
appropriate function parameters and graph the function. We will use the Microsoft Chart control for the
graph. The user can also set the x- and y-axis bounds and the number of points used to graph the
function.
PART A
First, create the interface in Visual C# .NET. Place a TabControl on your form that has three tabs. One
tab should be used for selecting the graph type and providing the parameters of the equation. A second
tab is used for selecting the x- and y-axis bounds. The final tab is used for displaying the graph. Figure 1
shows an example of what sample program looks like when running. Recall that a parabola is of the form
y = ax2+ bx + c.
Figure 1- Sample program images
PART B:
The user is now expected to enter the parameters using the TextBoxes provided. After they enter the
parameters for the parabola, they should click the Graph tab to graph the function.
Write the code that will execute when the graph tab is selected. When a tab of a TabControl is selected,
it triggers a SelectedIndexChanged event. You must use an If or Select Case statement to determine
which index was selected and perform the appropriate task based on that information. Remember that
the SelectedIndex starts at 0.
There are two major tasks that are performed when the graph tab is selected. First, all the labels on this
graph need to be updated. These labels are used to display the maximum and minimum axis values, the
number of data points graphed, and the equation that is being graphed (the parabola with parameters
plugged in, i.e.-2x^2+3x +4). In order to keep your code organized, you should write a method to
perform this task.
You should also write a method to fill the data in your graph. When this method is executed, the program
will set the axis on the Microsoft Chart Control according to what they have selected and graph the
function. To set the minimum and maximum values for the Y-axis, you can access the chart's ChartArea:
d
myChart.ChartAreas[0].Axes[1].Minimum = ;
myChart.ChartAreas[0].Axes[1].Maximum = ;
The Axes[1] refers to the Y-axis, Axes[0] would refer to the X-axis properties.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions