Project#5 - Sheet1 Page

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Sheet1 Page 1---------------------------------------------------------------- main.c---------------------------------------------------------------- #include "resistorList.h" int main(void) { resistorListPtr startPtr = NULL int choice,id double value printf("Enter your choice: (1)insert (2)delete (3)exit\n") printf(">> ") scanf("%d",&choice) while(choice!=3) { if(choice==1) { printf("\nEnter the resistor ID and value of resistance: ") scanf("%d%lf",&id,&value) insertResistor(&startPtr, id, value) printResistance(startPtr) } else if(choice==2) { if(startPtr==NULL) printf("List is empty.\n\n") else { printf("\nEnter a resistor ID to delete: ") scanf("%d",&id) deleteResistor(&startPtr, id) printResistance(startPtr) } } else printf("Invalid Choice.\n\n") printf("Enter your choice: (1)insert (2)delete (3)exit\n") printf(">> ") scanf("%d",&choice) } return 0 }----------------------------------------------------------------------------------- insertResistor.c------------------------------------------------------------------------------------...
View Full Document

Page1 / 4

Project#5 - Sheet1 Page

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online