
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
DO NOT COPY AND PASTE THE ANSWER THAT CHEGG HAS FOR THIS QUESTION. I HAVE ASKED THIS QUESTION ONCE AND THE "EXPERT" COPIED AND PASTED THE ANSWER FROM CHEGG. PLEASE ACTUALLY SOLVE THIS PROBLEM, OR I'LL JUST HAVE TO CANCEL MY BARTLEBY SUBSCRIPTION.
C++ Question
Hello Please answer the following attached C++

Transcribed Image Text:**Contact Management Program Instructions**
This program allows users to create and manage a contact list stored in a file called `MyContacts.txt`. Each contact includes a name and a phone number. Here are the detailed instructions:
1. **File Structure**:
- Each line in the file contains a contact's name followed by their phone number.
- Names are assumed to be a single word (no last names).
Example of file content:
```
Bob 555-1234
Jill 555-4321
```
2. **Handling Non-Existent Files**:
- If the program attempts to read a non-existent file, it will crash.
- Users should add a contact as their first step, which will create a new file if it does not already exist. This occurs within the `addContact` method.
3. **User Options**:
- The program operates in a loop, repeatedly asking users to select an option and executing the corresponding task:
1. **Print List**:
- Function: `printList()`
- This function outputs the contacts in `MyContacts.txt` formatted as:
```
Contact 1: Bob Phone Number: 555-1234
Contact 2: Jill Phone Number: 555-4321
```
2. **Find Number**:
- Function: `findNumber()`
- Users enter a name, and the function searches for the corresponding phone number in `MyContacts.txt`.
- If found, it returns the phone number; otherwise, it returns an empty string.
- The main program prints the result or notifies if the contact does not exist.
3. **Add Contact**:
- Function: `addContact()`
- Allows users to input a name and phone number, which are then appended to `MyContacts.txt`.
- Assumes users will enter single-word names.
4. **Quit**:
- Exits the program.
Each of these functions is designed to facilitate easy management of personal contacts through simple console interactions.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Please complete this program in C++ Please enusre that there is plenty of comments. PLENTY even if unessessary. Please include screenshots of actual code, screenshots of output, and code in the browser so I can copy and paste. Thank you.arrow_forwardYou guys are giving me wrong answer every time. This is last warning Don't try to copy other's content or don't us any AI otherwise I'll definitely give multiple downvotes and will report your accountarrow_forwardSubject: programming language : c++ Question : Jane has opened a new fitness center with charges of 2500 per month so the cost to become a member of a fitness center is as follow :1.For senior citizens discount is 30 %2. For young one the discount is 15 %3. For adult the discount is 20% Write a menu driven program (using structure c++) thata. Add a new memberb. Display the general information on about the fitness center and its chargesc. Determine the cost of a new membershipd. At any time show the total money made.Use appropriate parameters to pass information on and out of a function.arrow_forward
- Help pleasearrow_forwardHello. Please answer the following C programming question correctly by fulfilling all of the directions. Please do not use very advanced syntax to solve the problem and do not use string.h and all functions in this library. Also, please create a complete file header based on the file header style picture. *If correctly fulfill and answer all of the directions correctly, I will give you a thumbs up. Thanks. —------------------------------------------------------------------------------------------------------------------ Question - Instructions: ** For the following question and its steps, do not use string.h and all functions in this library. Step 1. Write a function to reverse a string. Function name: reverse_str Return type: void Parameter list: a pointer to a char Please don’t print the array backward. Don’t use another array to make the string reversed. You should reverse the string in place. Function Description: This function reverses a string by swapping the first character…arrow_forwardAssignment #2 Instructions: Through this programming assignment, the students will learn to do the following: Learn to work with command line options and arguments Gain more experience with Makefiles Gain more experience with Unix Learn to use some of the available math functions available with C Usage: mortgagepmt [-s] -r rate [-d downpayment] price In this assignment, you are asked to perform a mortgage payment calculation. All information needed for this will be passed to the program on the command line. There will be no user input during the execution of the program You will need a few pieces of information. The price of the home and the amount of the down payment. You will also need to know the interest rate and the term of the mortgage. To figure your mortgage payment, start by converting your annual interest rate to a monthly interest rate by dividing by 12. Next, add 1 to the monthly rate. Third, multiply the number of years in the term of the mortgage by 12 to calculate the…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education