Help for this question...Using Linked List ,pointers, C Structure~

Assume the following definitions:

struct CardRecType {
char cardID[10];
float balancePt;
};
typedef struct CardRecType CardRec;

struct nodeRec {

CardRec card;

Struct nodeRec *nextPtr;
};
typedef struct nodeRec Node;


struct LinkedListRec
{
int count;
Node *headPtr;
};
typedef struct LinkedListRec List;


Task 1
Modify the function definitions that were given in the lecture note to do the following task:

a.
Create a function makeNode to make a new node for a card record.

b.
Create a function printList to print the card records in the list.

c.
Create a function setPosition to go to a position in the list.

d.
Create a function insertRecord to insert a card record at a position in the list.

e.
Create a function deleteRecord to delete a card record from a position in the list.


Task 2
Write set of statements to accomplish each of the following. Assume that the nodes in the list must be in order according to card ID and all the manipulations occur in main program:

a)Provide any necessary declarations and statements for prepaid card database. Initially, the list is empty. You are required to initialize the list here.

b) Provide the statements to insert the following card records in order they appear. The nodes containing the following data for card ID and balance points:
Card ID Balance Point
7715005 91.5
6514004 25.0
3413003 85.0
8016006 10.5
2312002 66.5

You need to find out yourself the correct position of each prepaid card record when make call to the insertRecord function.

c) Provide the statement(s) to delete ″7715005″ from the list.

d) Call the printList function that prints the data in each node of the list after each insertion and deletion.
I beg u all help me..T_T urgent...
can teach me step by step oso can...:(
Topic archived. No new replies allowed.