Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Ok this is a programming question. It is on pg 535 Chapter 10 of java software s

ID: 644213 • Letter: O

Question

Ok this is a programming question. It is on pg 535 Chapter 10 of java software solutions 8th edition (Lewis Loftus) also probably in the 7th edtion as well. anyway here it is.

Design and implement an application that draws the graph of the equation ax^2 + bx + c, where the values of a, b, and c are set using three sliders.

Note it was not specified what range to put on a, b, c. so do whatever seems reasonable -20 to 20. or if for some reason that will not work do 0 to 10

I am going to post this with the maximum amount of time and points so please comment on your code. Thank you very much in advanced for answering.

Explanation / Answer

private JPanel drawPanel; //don't forget to create a proper one! override paint in that panel! private int a,b,c; public QuadraticPanel(){ //constructor setLayout(new BoderLayout(); JSlider aSidler = new JSlider(); slider.addChangeListener(new ChangeListener(){ @Override public void stateChanged(ChangeEvent arg0) { a = arg0.getValue(); //setting a value //it might even be better to calculate the value //BEFORE you redraw //recalcEquotiation() drawPanel.repaint(); //and redraw the paint-panel } }); add(aSlider, Borderlayout.WEST); //add more sliders with better layouts or subcomponents add(drawPanel, BorderLayout.CENTER); }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote