Page 1 of 1
ais project is adapted from the programming project 8 of Chapter 2 of the book titled Data Structures \& Other Objects U
Posted: Tue Jul 12, 2022 8:22 am
by answerhappygod

- Ais Project Is Adapted From The Programming Project 8 Of Chapter 2 Of The Book Titled Data Structures Other Objects U 1 (91.52 KiB) Viewed 48 times

- Ais Project Is Adapted From The Programming Project 8 Of Chapter 2 Of The Book Titled Data Structures Other Objects U 2 (30.35 KiB) Viewed 48 times
ais project is adapted from the programming project 8 of Chapter 2 of the book titled Data Structures \& Other Objects Using Java", 3rd edition, by Michael Main. one-variable quadratic expression is an arithmetic expression of the form ax2+bx+c, here a,b, and c are some fixed numbers (called coefficients) and x is a variable that can ke on different values. 1. Specify, design and implement a class named Quadratic that can store information about a quadratic expression. The constructor should set all three coefficients to zero, and another method should allow you to change these coefficients. There should be accessor methods to retrieve the current values of the coefficients. There should also be a method to allow you to evaluate the quadratic expression at a particular value of x, that is, the method has one parameter x and returns the value of the expression ax2+bx+c. Also write the following methods to perform these indicated operations: public static Quadratic sum(Quadratic q1, Quadratic q2) // Post-condition: The return value is the quadratic expression obtained by adding 1/ql and q2. For example, the coefficient of the return value is the sum of q1 's c // coefficient and q2 's c coefficient. public static Quadratic scale(double r, Quadratic q2) // Post-condition: The return value is the quadratic expression obtained by // multiplying each of q 's coefficients by the number r. public boolean equals(Object q) // Post-condition: returns true if and only if q refers to a Quadratic object and its // state is the same as this Quaratic object. public Quadratic clone 0 // Post-condition: returns a separate copy of this Quadratic object. public String toString0 // Post-condition: returns a string representation of this Quadratic object. 2. Implement a separate class named QuadraticDemo that contains a main method that creates Quadratic objects and demonstrates Quadratic methods. Every method except the constructor need be demonstrated.
lease submit 1. Analysis: test data; 2. Design: - Class diagrams showing representation of data; - A class invariant for each class; - Pre/Post conditions for required operations; - Algorithms for required operations. Algorithms can be described in English, flow diagrams, or sequence diagrams; 3. Code; 4. Sereen snapshots of test runs.