Starting from:

$25

CSE102 - Computer Programming with C - Assignment 0 - Solved

This assignment will get you acquainted with C language basics and the development environment.

You are expected to complete the code in the given project. The project files are given in the attached ZIP file (hw0_src). There are two files you are expected to modify with the following tasks:

1.       main.c: In the main function, you are expected to read two fractional numbers (a fractional number is composed of two integers representing the numerator and denominator of the fraction) and perform the four basic arithmetic operations on these, namely, addition, subtraction, multiplication and division. You are expected to use the function provided in utils.h. 

2.       utils.c: There are six functions in this file. Two of them are fully implemented for you. The other four, you are expected to complete them to provide the correct functionality. Note that two fractions after going through an arithmetic operaction may need to be simplified. The simplification is done by dividing both the numerator and denominator by their greatest common divisor. This means that you will need to find the GCD of two integers (you do not need to write a separate function for this). 

Besides writing some C code as indicated above, the purpose of this assignment is to teach you how makefiles work and how to edit C files and compile them on Ubuntu using GCC (version provided in class)  will be used to test your codes .

More products