Write a program that asks for user's name, phone number and address. The program then saves all information in a data file (each information in one line) named list.txt Finally, the program reads the information from the file and displays it on the screen in the following format: Name: (User's Name without the parentheses) Phone Number: (User's Phone Number with dashes but not parentheses) Address: (User's Street Address without the parentheses) (User's City, State, and Zip Code without the parentheses)

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

C++

cout << "Homework 5 Part 2";

cout << "Enter the name of the user ";

getline(cin, name);

string name, phoneNumber, address, city;

outfile.open("list.txt");

outFile << "Name: " << name << endl;

outfile.close();

 

Write a program that asks for user's name, phone number and address. The program
then saves all information in a data file (each information in one line) named list.txt
Finally, the program reads the information from the file and displays it on the screen in
the following format:
Name: (User's Name without the parentheses)
Phone Number: (User's Phone Number with dashes but not parentheses)
Address: (User's Street Address without the parentheses)
(User's City, State, and Zip Code without the parentheses)
Transcribed Image Text:Write a program that asks for user's name, phone number and address. The program then saves all information in a data file (each information in one line) named list.txt Finally, the program reads the information from the file and displays it on the screen in the following format: Name: (User's Name without the parentheses) Phone Number: (User's Phone Number with dashes but not parentheses) Address: (User's Street Address without the parentheses) (User's City, State, and Zip Code without the parentheses)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
List
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT