Study the scenario and complete the question(s) that follow: Evaluation of Polynomial Function A polynomial of degree n is a function of the form f(x) = a,x* + an-1x"-1+..+ a;x? + aix + as where the as are real numbers (sometimes called the coefficients of the polynomial). Although this general formula might look quite complicated, particular examples are much simpler. For example, f(x) = 4x' – 3x + 2 is a polynomial of degree 3, as 3 is the highest power of x in the formula. This is called a cubic polynomial, or just cubic. Based on the information provided in the above scenario, develop a Java program using NetBeans that evaluates a polynomial function such that it prompts the user for the maximum degree of the function to create an array of size one more than that degree, the values for each coefficient in the function to set them, and the value of x to evaluate the value of the function. The program must then call required methods, calculate and display the degree of the polynomial function. Do the following in your Java program: 4.1 Create a constructor that accepts a parameter of type integer and sets the specified value to the degree and creates an array for coefficients and stores 0 for all coefficients. 4.2 Create a method called setsenetant.() that accepts two parameters and sets the specified value at the specified position in the array. 4.3 Create another method called evaluate that accepts a parameter and then calculates and return a value of the polynomial function for the specified value. 4.4 Prompt the user for the maximum degree of the polynomial function.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Answer should be in Java
Study the scenario and complete the question(s) that follow:
Evaluation of Polynomial Function
A polynomial of degree n is a function of the form
f(x) = a,x" + an-1xn-1 + ..+ azx? + a,x + as
where the as are real numbers (sometimes called the coefficients of the polynomial). Although this
general formula might look quite complicated, particular examples are much simpler. For example,
f(x) = 4x³ – 3x² + 2
is a polynomial of degree 3, as 3 is the highest power of x in the formula. This is called a cubic
polynomial, or just cubic.
Based on the information provided in the above scenario, develop a Java program using
NetBeans that evaluates a polynomial function such that it prompts the user for the maximum
degree of the function to create an array of size one more than that degree, the values for each
coefficient in the function to set them, and the value of x to evaluate the value of the function.
The program must then call required methods, calculate and display the degree of the polynomial
function. Do the following in your Java program:
4.1 Create a constructor that accepts a parameter of type integer and sets the specified value to
the degree and creates an array for coefficients and stores 0 for all coefficients.
4.2 Create a method called getcenstant.() that accepts two parameters and sets the specified
value at the specified position in the array.
4.3 Create another method called evaluate that accepts a parameter and then calculates and
return a value of the polynomial function for the specified value.
4.4 Prompt the user for the maximum degree of the polynomial function.
Transcribed Image Text:Study the scenario and complete the question(s) that follow: Evaluation of Polynomial Function A polynomial of degree n is a function of the form f(x) = a,x" + an-1xn-1 + ..+ azx? + a,x + as where the as are real numbers (sometimes called the coefficients of the polynomial). Although this general formula might look quite complicated, particular examples are much simpler. For example, f(x) = 4x³ – 3x² + 2 is a polynomial of degree 3, as 3 is the highest power of x in the formula. This is called a cubic polynomial, or just cubic. Based on the information provided in the above scenario, develop a Java program using NetBeans that evaluates a polynomial function such that it prompts the user for the maximum degree of the function to create an array of size one more than that degree, the values for each coefficient in the function to set them, and the value of x to evaluate the value of the function. The program must then call required methods, calculate and display the degree of the polynomial function. Do the following in your Java program: 4.1 Create a constructor that accepts a parameter of type integer and sets the specified value to the degree and creates an array for coefficients and stores 0 for all coefficients. 4.2 Create a method called getcenstant.() that accepts two parameters and sets the specified value at the specified position in the array. 4.3 Create another method called evaluate that accepts a parameter and then calculates and return a value of the polynomial function for the specified value. 4.4 Prompt the user for the maximum degree of the polynomial function.
4.5 Create an object for the class with the maximum degree entered by the user.
4.6 Prompt the user to enter each coefficient and call the setsenstaat () method to set the
coefficient value in the array.
4.7 Prompt the user to enter a value of x and call the evaluate method to get and display the
value of the polynomial function.
Transcribed Image Text:4.5 Create an object for the class with the maximum degree entered by the user. 4.6 Prompt the user to enter each coefficient and call the setsenstaat () method to set the coefficient value in the array. 4.7 Prompt the user to enter a value of x and call the evaluate method to get and display the value of the polynomial function.
Expert Solution
steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY