Starting from:

$30

HW 1 Solution

(50Pts) Examine the code below. It calculates the integral of a 1st degree polynomial.
Correct all syntax and logical errors in the code. Compile and link the code using the gcc compiler under Linux. Run the executable file obtained from the code, make sure that it works properly. Test it with several inputs. Submit both the error-free source code and the screen out of the executable (screen capture after an execution).







(50 Pts) Change the code in part 1 so that it takes 2 polynomials of 2nd degree and outputs the multiplication of them.



For example, if the following polynomials are given




2.5
3
0
1
2
1



your program should output




2.5 x^4 + 8 x^3 + 8.5 x^2 + 3 x + 0




where x^3 means x3.




Redirect input and output stream for your program to input and output files. Produce

console screen-shot including:

Creation of input text file (without using any editors)



Execution of your code with i/o redirection



Monitoring the content of the output text file (without using any editors)



General:

Obey honor code principles.
Obey coding convention.
Submit your HW using moodle system. Your submission should include the following files only:
HW00_<student_name_<studentSirname_<student number_part1.c HW00_<student_name_<studentSirname_<student number_part1.jpg HW00_<student_name_<studentSirname_<student number_part2.c HW00_<student_name_<studentSirname_<student number_part2.jpg




Deliver the printout of your work (all 4 files) until the last submission date.
Do not use non-English characters in any part of your homework (in body, file name, etc.).

More products