[SOLVED] CSE102 Assignment 0-C language basics

30.00 $

Category: Tags: , , , , ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon assignment-0-h6lxcc.zip (145 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product

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 and grade them.

General Rules:

  • Obey the style guidelines.
  • Do not change the provided function prototypes (you will not get any credits).
  • The program must be developed on Ubuntu using GCC compiler (version provided in class),compilation problems due to the use of another OS or compiler is your responsibility (you will

    not get any credits).

  • Your program should work as expected. Do not expect partial credit if your code works only insome cases but not in all cases as expected.
  • You can ask your questions about the homework by positing on the forum in Teams.Handing in your work:
    • Hand in your work using the appropriate class Teams assignment site.
    • No late submissions will be accepted.
    • Please pack your solution directory in the following way (assuming a student with number20180000001 and name X Y Z is submitting):

o A directory named 20180000001_X_Z is created
o All the solutions files along with a make file are created as part of the assignment. For

example:

Page 1 of 2

CSE102 – Spring 2022 Assignment #0

o Pack this directory into a zip file named 20180000001_X_Z.zip
o WhenunpackedasaboveinUbuntu(versionprovidedinclass)itshouldallowexecuting

the following commands in a shell:

  • ▪  “$make clean” removes everything except makefile, source code (.c and .h) andother resource files (if any) – all compiling results and intermediate files should

    be removed.

  • ▪  “$make compile” should compile the code.
  • ▪  “$make run” should run the code along with any parameters needed.

Page 2 of 2

  • assignment-0-h6lxcc.zip