Question: Need help with Java coding for a class with mathematical functions: Complete the implementation of the following class. This class will model a class variable

Need help with Java coding for a class with mathematical functions:

Complete the implementation of the following class. This class will model a class variable to hold a mathematical function of up to 10 terms. The function will have one independent variable.

Terms that the function will model are:

-Monomials of the form: 5.3x^0.5

-Trigonometric terms sin(x), cos(x), tan(x) of the form: 1.2cos(3.0x)

public class Function { // PLEASE leave your class name as Function

// CLASS VARIABLES

// use any collection of variables as you see fit.

// CONSTRUCTORS

Intialize Function to f(x)=0

public Function() {

}

// Set Function to f(x)=c

public Function(double c) {

}

// Set Function to f(x)=bx+c

public Function(double b, double c) {

}

// Set Function to f(x)=ax^2+bx+c

public Function(double a, double b, double c) {

}

// Set Function to f(x)=coeff*trigFunction(px)

// - angle in radians

// allow trigFunction to be "sin", "cos" or "tan"; set f(x)=0 for

unknown trigFunctions.

public Function(double coeff, String trigFunction, double p) {

}

// Add a polynomial term of the form: Cx^P. to the Function

public void addTerm(double C, double P) {

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!