aboutsummaryrefslogtreecommitdiff
path: root/Project1/program.cpp
blob: 0709b6c47d3adabc849ad35f2e3b1c1ae461ad63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// name: Connor McDowell
// date: 2/19/2024
// class: CST116
// reason: homework number 6

#include "Contacts.h"
#include <iostream>

using std::cin;
using std::cout;
using std::endl;

constexpr size_t MAX = 3;

int main()
{
    int O = 1;
    constexpr size_t MAX = 3;
    size_t Cont_list_lenth = 0;
    contact* newContact = new contact[3];
    while (O == 1)
    {
        cout << Cont_list_lenth << endl;
        int c = 0;
        cout << "1. Enter a contact\n";
        cout << "2. Update a contact\n";
        cout << "3. print all contacts\n";
        cout << "4. Delete a contact\n";
        cout << "5. Quit\n";
        cout << "\nEnter your choice: " << endl;
        cin >> c;
        //c = menu();
        if (c == 1)
        {
            Cont_list_lenth++;
            addNew(&newContact[Cont_list_lenth], MAX, Cont_list_lenth);
        }
        if (c == 2)
        {
            update(&newContact[Cont_list_lenth], MAX);
        }
        if (c == 3)
        {
            printAll(&newContact[Cont_list_lenth], MAX, Cont_list_lenth);
        }
        if (c == 4)
        {
            //work in progress
        }
        if (c == 5)
        {
            delete[] newContact;
            return 0;
        }
        
    }
}