Solved–HW 1– Solution

$30.00 $19.00

(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…

You’ll get a: . zip file solution

 

 
Categorys:
Tags:

Description

5/5 – (2 votes)
  1. (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).

  1. (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:

  1. Obey honor code principles.

  2. Obey coding convention.

  3. 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

  1. Deliver the printout of your work (all 4 files) until the last submission date.

  2. Do not use non-English characters in any part of your homework (in body, file name, etc.).