Need help working through CLion:
Description: For this assignment you will create a program to manage phone contacts. Your program will allow the user to add new phone contacts, display a list of all contacts, search for a specific contact by name, delete a specific contact. Your program should provide the user with a console or command line choice menu about possible actions that they can perform. The choices should be the following:
1. Display list of all contacts.
2. Add a new contact.
3. Exit Program
To represent a contact in your program, create a struct named Contact with the following fields: • firstName - string • lastName - string • phoneNumber - long • phoneType – enum PhoneType The PhoneType can be only one of the following: “CELL”, “HOME”, “WORK”
/* * C++ Program for managing contacts */ #include <iostream> #include <string> #include <vector> using namespace std; enum PhoneType { CELL = 0, HOME = 1, WORK = 2 }; struct Contact { string firstName; string lastName; long phoneNumber; PhoneType phoneType; }; void setContact(Contact &C) { int n; cout << "Enter First Name : "; cin >> C.firstName; cout << "Enter Last Name : "; cin >> C.lastName; cout << "Enter Phone Number : "; cin >> C.phoneNumber; cout << "Enter Phone Type : "; cin >> n; C.phoneType = (PhoneType)n; } void getContact(Contact C) { cout << "Name : " << C.firstName << " " << C.lastName << endl; cout << "Phone Number : " << C.phoneNumber << endl; cout << "Phone Type : " << C.phoneType; } int main() { char ch; vector<Contact> ConVect; Contact tempCon; do { int choice; cout << "Menu" << endl; cout << "1. Display list of all contacts" << endl; cout << "2. Add a new contact" << endl; cout << "3. Search for a contact" << endl; cout << "4. Delete a contact" << endl; cout << "5. Exit Program" << endl; cout << endl; cout << "Enter Choice : "; cin >> choice; string name; switch(choice) { case 1 : cout << endl; for(int i = 0; i < ConVect.size(); i++) { getContact(ConVect[i]); } cout << endl; break; case 2 : cout << endl; setContact(tempCon); ConVect.push_back(tempCon); break; case 3 : cout << endl; cout << "Enter first name to search: "; cin >> name; for(int i = 0; i < ConVect.size(); i++) { if(ConVect[i].firstName == name) { cout << "Found at index #" << i << endl; getContact(ConVect[i]); cout << endl; break; } } break; case 4 : cout << endl; cout << "Enter first name to delete: "; cin >> name; for(int i = 0; i < ConVect.size(); i++) { if(ConVect[i].firstName == name) { ConVect.erase(ConVect.begin() + i); cout << "Deleted" << endl; break; } } break; case 5 : exit(1); } cout << "Continue (Y/N): "; cin >> ch; cout << endl; } while(ch == 'Y' || ch == 'y'); return 0; } /* Program ends here */
Need help working through CLion: Description: For this assignment you will create a program to manage...
DESCRIPTION Create a C++ program to manage phone contacts. The program will allow the user to add new phone contacts, display a list of all contacts, search for a specific contact by name, delete a specific contact. The program should provide the user with a console or command line choice menu about possible actions that they can perform. The choices should be the following: 1. Display list of all contacts. 2. Add a new contact. 3. Search for a contact...
Please help!! (C++ PROGRAM) You will design an online contact list to keep track of names and phone numbers. · a. Define a class contactList that can store a name and up to 3 phone numbers (use an array for the phone numbers). Use constructors to automatically initialize the member variables. b.Add the following operations to your program: i. Add a new contact. Ask the user to enter the name and up to 3 phone numbers. ii. Delete a contact...
a. Define the struct node that can store a name and up to 3 phone numbers (use an array for the phone numbers). The node struct will also store the address to the next node. b. Define a class contactList that will define a variable to keep track of the number of contacts in the list, a pointer to the first and last node of the list. c. Add the following methods to the class: i. Add a new contact....
In this assignment, you will create an application that holds a list of contact information. You will be able to prompt the user for a new contact, which is added to the list. You can print the contact list at any time. You will also be able to save the contact list. MUST BE IN PYTHON FORMAT Create the folllowing objects: ContactsItem - attributes hold the values for the contact, including FirstName - 20 characters LastName - 20 characters Address...
In this assignment, you will create an application that holds a list of contact information. You will be able to prompt the user for a new contact, which is added to the list. You can print the contact list at any time. You will also be able to save the contact list. Must Be In Python Format Create the following objects: ContactsItem - attributes hold the values for the contact, including FirstName - 20 characters LastName - 20 characters Address...
Hw08FinalProjectStudentList.txt: (Data structure is Array List) 1,Simon,Jefferson,gy3085,4.0,2019 2,John,Johnson,xy1242,3.9,2019 3,Kayla,Anderson,as1324,3.8,2019 4,David,Kidman,re5423,3.8,2017 5,Mary,Coleman,ze7698,3.8,2018 Description: This assignment is going to evaluate your overall knowledge of the Java Programming. You shall implement a program which can store and retrieve student list. The program has a menu that you can take input from console, and the user can choose between the items. The program data is in the HwO8FinalProjectStudentList.txt file. Required Items: 1. The program must show a menu to user and ask the user...
Hw08FinalProjectStudentList.txt 1,Simon,Jefferson,gy3085,4.0,2019 2,John,Johnson,xy1242,3.9,2019 3,Kayla,Anderson,as1324,3.8,2019 4,David,Kidman,re5423,3.8,2017 5,Mary,Coleman,ze7698,3.8,2018 Description: This assignment is going to evaluate your overall knowledge of the Java Programming. You shall implement a program which can store and retrieve student list. The program has a menu that you can take input from console, and the user can choose between the items. The program data is in the HwO8FinalProjectStudentList.txt file. Required Items: 1. The program must show a menu to user and ask the user can either choose between the...
write a ContactBook in C++ ContactBook that holds 10 names with that names corresponding contact (last name and first name of the owner). Ask the user to input up to 10 Contacts (It may be less. The user should have the ability to stop inputting Contacts whenever he wishes). 3.This class will store a list of Contacts in a stack allocated array of default capacity 10. 4.You must be able to add new contacts to a list, delete old contacts,...
Requirements Create an Address Book class in Java for general use with the following behaviors: 1. Constructor: public Address Book Construct a new address book object. • A contact has four fields: first name, last name, email and phone. (There could be more information for a real contact. But these are sufficient for the assignment.) . The constructor reads from the disk to retrieve previously entered contacts. If previous contacts exist, the address book will be populated with those contacts...
This assignment was locked Mar 24 at 11:59pm. For this lab you will implement a phone book using a linked list to keep people's names and phone numbers organized in alphabetical order. 1. Define a structure to hold the contact information including: name, phone number, a pointer to the next node in the list. Example: struct ContactNode { string name; string phoneNumber; ContactNode *next; } 2. Define a class containing the structure and the appropriate methods to update and retrieve...