Write a Pentium program that calculates and prints out (in a nice form) the first derivative of a simple polynomial.
Sample program run:
Enter degree of polynomial:
3
Enter coefficient of x^3:
2
Enter coefficient of x^2:
-7
Enter coefficient of x^1:
0
Enter coefficient of x^0:
25
The polynomial entered is
2*x^3+-7*x^2+25
The first derivative is
6*x^2+-14*x^1
123123000 +123 -123 0 +0 -0 000
-123.34<- value is -123, the '.' terminates the int 12:45 PM <- value of 1st int is 12, the ':' terminates the int 0a +000123 <- octal int in C, can't have leading zero - 123 <- sign needs to be next to 1st digit 0x123 <- a hex int, also, 'x' is not a digit abc
get_poly
-- a procedure that gets and places in an array the coefficients
of the user entered polynomial. The input parameter
to the procedure is the address of the array.
This procedure calls
function get_int
to get the coefficients from the user.
put_poly
-- a procedure that prints out a polynomial in a nice form.
The input parameter to the procedure is the address
of the array containing the polynomial. This procedure calls procedure
print_int
to print out the coefficients of the polynomial.
get_int
-- a function, which returns
a flag indicating an error detected in user input.
The single parameter to this procedure is the address of
an integer variable.
The function uses the address as the location to place the
integer it gets.
print_int
-- a procedure which prints out an integer passed to the
procedure.
derivative
-- a procedure which calculates the
derivative.
The procedure receives one parameter:
the address of the array containing the coefficients.
get_int
and print_int
.
get_poly
and
put_poly
first, before implementing the derivative procedure.
Follow the guidelines in
how to turn in assignments.
For this program, you will need to turn in your source code
(the .asm
extension) and your makefile
(the .mak
extension).
No printout will be turned in.
There is NO homework with this assignment. The program will keep you busy enough!