Introduction

The goal of this assignment is to write an application that reads in a data file and stores the data as a linked list.

Create a linked list node to include

char name[50];
int id;
struct node *next;

main()

  • Call the function to read in the data file as a linked list Provide the user a menu of the following options
    • Insert
    • Display
    • Delete by ID
    • Delete by Name
    • Exit
  • Use a conditional statement to evaluate the user’s selection
  • if option 1, call function to insert a new student
  • if option 2, call function to display the linked list
  • if option 3, call function to delete by id number
  • if option 4, call function to delete by student name
  • if option 5, exit the program

Function to read the data file as nodes in a linked list

  • Read in the contents of data file "AssignmentOneInput.txt" into the node data structure

Function to insert a new student

  • Prompt the user for the student’s name
  • Prompt the user for the student’s id number
  • Populate an instance of the linked list node with the data
  • Add the new node to the existing linked list

Function to display the linked list

  • Traverse the linked list and display the data of each node

Function to delete by id number

  • Prompt the user for the student’s id number
  • Traverse the linked list to find the entered id number
  • If it exists delete it and inform the user it has been deletedIf it does not exit inform the user the entered id number was not found

Function to delete by name (Displayed name based on Option 2)

  • Prompt the user for the student’s name
  • Traverse the linked list to find the entered name
  • If it exists delete it and inform the user it has been deleted
  • If it does not exist inform the user the entered name was not found

Exit the program

  • Write the appropriate code to exit the program
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.