From 36c4160b5a2a4734eda79ac04d216f003c4b8368 Mon Sep 17 00:00:00 2001 From: Asahel Date: Mon, 12 Feb 2024 18:03:30 -0800 Subject: Saving work --- Homework5/program.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 8 deletions(-) (limited to 'Homework5/program.cpp') diff --git a/Homework5/program.cpp b/Homework5/program.cpp index f026a4b..c08993f 100644 --- a/Homework5/program.cpp +++ b/Homework5/program.cpp @@ -3,12 +3,48 @@ // Class: CST 116 // Assignment: Homework 5 -struct Contact +#include +#include +#include "Contacts.h" + +using std::cout; +using std::cin; +using std::endl; + +int main() { - char Namr[25] = {}; - char Email[100] = {}; - char StreetAddress[35] = {}; - char City[30] = {}; - char State[2] = {}; - int Zip = 0; -}; \ No newline at end of file + const int MAX = 10; + + Contact contacts[MAX] = {}; + int numberOfContacts = 0; + + char c = 'n'; + + do { + system("cls"); + cout << "1. Add New Contact\n"; + cout << "2. Update Contact\n"; + cout << "3. Print Contacts\n"; + cout << "Press 'x' to Exit\n\n"; + std::cin >> c; + switch (c) + { + case '1': + contacts[numberOfContacts++] = InputNewContact(); + break; + case '2': + + + break; + case '3': + break; + case 'x': + break; + default: + cout << "\nInvalid\n"; + } + + } while (c != 'x'); + + return 0; +} \ No newline at end of file -- cgit v1.2.3