[SOLVED] CSE102 Homework 1

30.00 $

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

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

zip file icon hw1-byrvyd.zip (117.9 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product
  • Write a C code which does the following (90 pts): Read file.txt

Remove repeated integers

  • At the beginning of your code, comment about the efficiency of your implementation( 10 pts)

Example

  • file.txt before any operation:

12             -5                          67               12 4                   -888 23 5 7 67 2

56        3                   67 6                 5

45                 -5                                         3 12 7 1

  • Your program finds the repeated integers and replaces their position with empty space
  • txt after the execution:

12             -5                          67                     4                 -888 23 5 7            2

56        3                          6

45                                                                             1

Remarks

  • Be careful with the name of the file (txt). You won’t be given a second chance if you make a mistake about this. Your program will fail and your grade will be 0.0.
  • Do not use any elements which is not covered in class. Do not use arrays.
  • Do not submit your code without testing it with several different scenarios.
  • Write comments in your code.
  • You can use ftell(), fseek() and other useful functions for file read/write operations.
  • Preserve the spacing in the txt. The positions of the numbers in the file should not be altered.
  • There can be negative and positive integers.
  • You can assume that the file is error-free. (i.e. there are only negative and positive integers in the file.)
  • Properly check end-of-file and succesful read/write operations.
  • Efficiency of your implementation is important. Comment about the efficiency of your code. (10 pts)

Turn in:

  • Source code of a complete C program. Name of the file should be in this format: <full_name>_<id>.c.
  • Example: c. Please do not use any Turkish special characters.
  • You don’t need to use an IDE for this assignment. Your code will be compiled and run in a command window.
  • Your code will be compiled and tested on a Linux machine(Ubuntu). GCC will be used.
  • Make sure that your program does not require specific encodings/markings/line-ending-chars. Make sure it works with a file created in a linux environment.
  • Make sure you don’t get compile errors when you issue this command : gcc <full_name>_<id>.c.
  • A script will be used in order to check the correctness of your results. So, be careful not to violate the expected output format.
  • Provide comments unless you are not interested in partial credit. (If I cannot easily understand your design, you may loose points.)
  • You may not get full credit if your implementation contradicts with the statements in this document.
  • hw1-byrvyd.zip