I'm still new to C and I need help creating the functions to be used in my code for my project.
So far this is what I've written. Here are the parameters/objectives:
OVERVIEW:
Create a simple address book program that stores the first name, last name, student number, degree
program, mobile number and email address of a student. The program will have five possible actions:
add a new entry, edit an existing entry, delete an existing entry, list all entries, and close the program.
The program should keep asking for the next action until the user closes the program.
CONSTRAINTS:
• Aside from your own functions, you are only allowed to use the functions in the following
libraries:
• stdio.h
• ctype.h
• string.h
• There should be a macro in your code defining the number of entries in your address book. The
maximum allowable number of entries is 30.
• There should be no recursive functions.
• The inputs should have the following error checking capabilities:
• first name, last name, degree program: can only contain letters and spaces, max of 20, at
least one character
• student number: can only contain digits and a dash, format is xxxx-yyyyy
• mobile number: can only contain digits, format is 09xxyyyyyyy
• email: can only contain letters, digits, underscores, dots, and @, max of 30
• Implement this using only the concepts discussed from lectures 1 to 8a.
Code:#include <stdio.h> #include <string.h> #define max_num 30 void add_contact(); void edit_contact(); void del_contact(); void list_contact(); int main() { char mode, size; char addressbook[6][30][30]; printf("Select the mode you want\n"); printf("1 -> Add contact\n"); printf("2 -> Edit contact\n"); printf("3 -> Delete contact\n"); printf("4 -> List contact\n"); printf("5 -> Exit the program\n"); scanf("%c", &mode); switch(mode){ //switch (determine which action to take case 1: add_contact(); break case 2: edit_contact(); break;s case 3: del_contact(); break; case 4: list_contact(); break; } //end switch return 0; }