
Create a class polynomial that is used to evaluate a polynomial function of x:
P(x) = a0 + a1x + a2x + ⋯ + an−1xn−1 + anxn
The coefficients ai are floating-point numbers, the exponents of x are integers, and the largest exponent n—called the degree of the polynomial—is greater than or equal to 0. The class has the attributes
■ degree —the value of the largest exponent n
■ coefficients —an array of the coefficients ai
and the following methods:
- Polynomial (max) —a constructor that creates a polynomial of degree max whose coefficients are all 0
- setConatant (i, value) —Sets the Coefficient ai to value
- evaluate (x) — returns the value of the polynomial for the given value x
For example, the polynomial
P(x) = 3 + 5x + 2x3
is of degree 3 and has coefficients a0 = 3, a1 = 5, a2 = 0, and a3 = 2. The invocation evaluate (7) computes 3 + 5 × 7 + 0 × 7 + 2 = 73, which is 3 + 35 + 0 + 686, and returns the result 724.

Want to see the full answer?
Check out a sample textbook solution
Chapter 7 Solutions
Java: An Introduction To Problem Solving And Programming Plus Mylab Programming With Pearson Etext -- Access Card Package (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects (9th Edition)
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Mechanics of Materials (10th Edition)
Concepts Of Programming Languages
- Show your manual work, submit a screenshot of your result Multiply 1. 00110112 × 001102 2. 01010102 x 001012 Divide 3) 11110002001112 4) 10001112001002arrow_forwardPerform the 8-bit 2's complement binary addition manually. Indicate the result and whether there is overflow or not. SHOW ALL WORK FOR FULL CREDIT. Submit your screenshot. Add: 1011 0000 + 1001 1111arrow_forwardWatch the "Cloud Computing Fundamentals" video, learn more about cloud computing, and study Ralph Stair's "Fundamentals of Information Systems" textbook, 9th edition. Research cloud computing and respond to the following discussion question: How would you describe the features, advantages, and drawbacks of cloud computing if you were a company's chief information officer?arrow_forward
- Please code the following in R: You will only need use of one package: dplyr Be sure to install that package and activate it while you use your project using library or attach statement. After this step, read in the 2 data sets (Quant.csv and Cat.csv) and combine them into one. When combined, the data frame should have 522 observations and 11 variables. Once combine, add the correct labels for the indicator values to each of the categorical variables. Some of the Cat data:arrow_forwardPlease provide the R code for the following question and discuss the results: The built in dataset iris has data on four floral measurements for three different species of iris. Make a pairs plot of the data. What relationships (correlations) look strongest? The grouping evident with the Species variable in the last plot should make you curious. Add the argument col=iris$Species to the last plot you made. Does this change your conclusions about correlations between any of the relationships? Can you make a lattice plot (xyplot()) showing Sepal.Length as a function of Sepal.Width for the different species?arrow_forwardYou are completing my “Lab Assignment 01 Worksheet” exactly as specified below. Produce ALL deliverables in one response, in the order given. Use clear headings that match the worksheet, include realistic Windows 10/11 screenshots, and provide copy-pasteable command output and links.arrow_forward
- Lab Assignment 01 Worksheet Connecting to printers on campus (1 mark) No screen shot required, print your demonstration sheet, and bring to lab for demonstration, the physical demonstration sheet itself is worth 1 point. Basic Operating System Maintenance (4 marks) Screen shot showing operating system is updated: Screen shot showing antivirus is updated: Screen shots showing use of ipconfig as requested Screen shots showing use of net start and net stop as requested Managing files (2 marks) Copy and paste the output from the tree command here: Create a windows backup and restore file(s) from it (2 marks) Screen shot of backup tool showing that a backup was created: List the specifications for a computer (1 mark) Hyperlink to reference laptop used as source of computer specifications: Computer Specifications as requested:arrow_forwardPlease code the following in R: 1a) The built in dataset iris has data on four floral measurements for three different species of iris. Make a pairs plot of the data. What relationships (correlations) look strongest? 1b)arrow_forwardPlease code the following in R: 3a) The built in data state.x77 (which can be loaded via data(state)) has data for the 50 US states. Fit a principal components analysis to this data. What proportion of variation is explained by the first three principal components? What variable has the greatest (absolute value) loading value on each of the first three principal components? (Note: the dataset state is a list of datasets one of which is a matrix named state.x77) 3b)arrow_forward
- Develop a script in a language of your choice (e.g., Python, PowerShell) that automates a routine network security task (e.g., scanning a network for open ports, automating log analysis for suspicious activities). Provide detailed comments within your code to explain its functionality. No AI use pleasearrow_forwardYou are using a web browser to load a webpage. Let's assume the size of the webpage is negligible. The access link rate of the webserver is 1 Gigabits per second. The IP address for the associated URL is not cached in your local host, so a DNS lookup is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1,..., RTTn. Let RTTo denote the RTT between the local host and the webserver containing the webpage. Now answer the following: 1) Ignore all types of delays at the client and the servers. How much time elapses from when the client clicks on the link of the webpage until the client receives the content of the webpage? 2) Now suppose, the HTML file references 10 additional objects (15 MB each) on the same server. Considering only the transmission delay at the webserver for each of these objects and ignoring all other delays at the host and the servers, recalculate the total…arrow_forwardPlease code the following in R. 1a) Load the data set “ufc” (the file is ufc.csv). This data shows diameter at breast height (Dbh) and Height for forest trees. Can you use unstack() to get the diameter data for white pine (WP)? Start by unstacking all the diameter data. Can you also get this data by logical extraction? (Hint: use the function which(). If you really only wanted the data for one species logical extraction would probably be better.) 1b) For the data set ufc find the mean Dbh and Height for each species. (Hint: aggregate is your friend for more than one response variable.) 1c) Make a barplot showing these mean values for each species. Use beside =TRUE (stacking two different variables wouldn’t make sense...). (Hint: this will be easier if you make a new variable for the means from Q2. Look at ?barplot for the data type “height” must have- as.matrix() can be used to make something a matrix.) 1d) The barplot in Q3 suggests a fair correlation between Dbh and height. Plot…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage




