Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions