Create a program that will read 1 or two of the polynomials
contained in the polynomial*.txt. If only one file is given to
the program, it should find the derivative of that polynomial.
If two files are given then the program should add the two polynomials.
Other concerns are as follows:
each of the polynomial*.txt contains a pair of numbers per line
i.e.
polynomial1.txt contains:
1 3
5 7
32 4
8 0
12 6
8 5
9 2
2 11
each pair of number in the polynomial1.txt represents a term in the polynomial,
the first number in the pair being the coefficient and the second is
the exponent of the term. For example the first pair 1 3 will represent
1x^3 in the polynomial.
The program should write its result in a text file "output.txt". The resulting
polynomial should be written in output.txt int the same format as the polynomial*.txt.
There shall be no user inputs. All inputs shall be passed as arguments in your program.
i.e.
%26gt;gcc -o myProgram myProgram.c
%26gt;./myProgram polynomial1.txt polynomia
Is there any C programmer that can help me with my assignments? pls pls..?
Well you can write a condition in the Main() which calls different functions baed on the argc number. in the each function you can just write codes to read the files and then do as you please with them. ^^
I'm too lazy to think this through xD
Reply:You can get help in c programmer from http://userstyle.org/
Reply:Surely the point is to do it yourself, hence you LEARN. Getting some to do it for you completely defeats the object of the assignment.
Reply:Look up each of the following, as they can be useful in this program:
scanf
fprintf
argv
argc
Other ways to write the same program, the following can be useful:
atoi
getline
Reply:Again I ask, what do you have so far? Did you want someone to do your homework FOR you? I can HELP you, but I won't do it FOR you. Get started, and show us what you have so far.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment