Question: you will create a C program for the following program: Program Specifications Your program will implement a user-defined (defined by you) linked list. The minimum

you will create a C program for the following program:

Program Specifications

  • Your program will implement a user-defined (defined by you) linked list.
  • The minimum requirements of the linked list are:
    • Add or delete items at the beginning of the list (push and pop)
    • Remove items from the end of the list
    • Remove a specific item by index or by value
  • The program will be interactive. At a minimum, the end-user will be able to print the list to the screen and add and delete values using the methods above.
  • The user will be able to search the list for a particular value.
  • The user will be able to input values using a text file and output the list to a text file.
  • Functions are to be used where appropriate to produce readable, reusable code. Library functions and user-defined functions should be used where appropriate.

Readability

  • Use indentation and spacing consistently. (e.g., every line in a loop is indented to align)
  • Add whitespace to help separate parts of the code. (e.g., empty line after a loop, space after a semicolon in a loop, etc.)
  • Give meaningful names to variables. Variables named x, y, and z are not descriptive and give the reader no information about their purpose; instead use names like primary, max, and counter. Loop condition variables are an exception because they are contained to a single area of the code and have a universally known function, so naming with a single letter (i, j, etc.) is acceptable.
  • Code should be organized into functions to reduce duplicate lines of code. Function definitions should be contained in a single section at the beginning of the program. Functions, like variables, should have meaningful names.

Documentation

  • Add a comment block at the beginning to indicate the purpose of the program
  • Add comments before each structure, function definition, loop and update statement: A programmer taking over your work should be able to pick up the project without additional research
  • Use either /* and */, or // for comments (the style chosen is up to you)

Coding Practice/Efficiency

In addition to the items listed above, you should follow good coding practice. This includes:

  • Keep lines of code to a reasonable length
  • Use a non-proportional front (Courier, Consolas), so characters are evenly spaced
  • Functions should perform a single operation; don't cram all code into a single function
  • Do not use global variables
  • Eliminate warnings from the compiler, as well as errors

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!