aboutsummaryrefslogtreecommitdiff
path: root/Project1/contacts.cpp
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-02-19 16:12:31 -0800
committerConnor McDowell <[email protected]>2024-02-19 16:12:31 -0800
commite2b6fbcc7c708d277443818bb36b33c4e943b5d7 (patch)
tree8709dd8f5119b1c95bdbbe0c6eeb47f1591b0dbf /Project1/contacts.cpp
parentprint fixed (diff)
downloadhomework-5-connormcdowell275-e2b6fbcc7c708d277443818bb36b33c4e943b5d7.tar.xz
homework-5-connormcdowell275-e2b6fbcc7c708d277443818bb36b33c4e943b5d7.zip
update fixed and finished, input couts created, assignment is doneHEADmain
Diffstat (limited to 'Project1/contacts.cpp')
-rw-r--r--Project1/contacts.cpp45
1 files changed, 23 insertions, 22 deletions
diff --git a/Project1/contacts.cpp b/Project1/contacts.cpp
index f4a89aa..573a8a7 100644
--- a/Project1/contacts.cpp
+++ b/Project1/contacts.cpp
@@ -26,6 +26,7 @@ char addNew(contact newContact[], size_t MAX, int t)
{
for (int i = t; i < MAX; i++)
{
+ cout << "Please enter all inputs as english characters with underscores (_) for spaces" << endl;
newContact[i].id = i + 1;
cout << "enter name: " << endl;
cin >> newContact[i].Name;
@@ -37,6 +38,7 @@ char addNew(contact newContact[], size_t MAX, int t)
cin >> newContact[i].City;
cout << "enter State: " << endl;
cin >> newContact[i].State;
+ cout << "Please enter the next value as a series of numbers" << endl;
cout << "enter Zip: " << endl;
cin >> newContact[i].Zip;
break;
@@ -55,30 +57,29 @@ char addNew(contact newContact[], size_t MAX, int t)
void update(struct contact newContact[], size_t MAX)
{
- cout << "select a contact to delete" << endl;
- int i = 0;
+ cout << "select a contact to update based on their position in the list (check print all contacts for list position)" << endl;
int c = 0;
- cin >> i;
- i = i - 1;
- if (i == newContact[i].id) {
- cin >> c;
- if (c == 1)
- {
- cout << "enter name: " << endl;
- cin >> newContact[i].Name;
- cout << "enter Email: " << endl;
- cin >> newContact[i].Email;
- cout << "enter Street Address: " << endl;
- cin >> newContact[i].StreetAddress;
- cout << "enter city: " << endl;
- cin >> newContact[i].City;
- cout << "enter State: " << endl;
- cin >> newContact[i].State;
- cout << "enter Zip: " << endl;
- cin >> newContact[i].Zip;
- }
+ cin >> c;
+ int t = c - 1;
+ for (int i = t; i < MAX;)
+ {
+ cout << "Please enter all inputs as english characters with underscores (_) for spaces" << endl;
+ newContact[i].id = c;
+ cout << "enter name: " << endl;
+ cin >> newContact[i].Name;
+ cout << "enter Email: " << endl;
+ cin >> newContact[i].Email;
+ cout << "enter Street Address: " << endl;
+ cin >> newContact[i].StreetAddress;
+ cout << "enter city: " << endl;
+ cin >> newContact[i].City;
+ cout << "enter State: " << endl;
+ cin >> newContact[i].State;
+ cout << "Please enter the next value as a series of numbers" << endl;
+ cout << "enter Zip: " << endl;
+ cin >> newContact[i].Zip;
+ break;
}
-
}
void printAll(contact newContact[], size_t MAX)