Problem Solving with C++ (10th Edition)
Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 18, Problem 9PP
Program Plan Intro

Elimination of Duplicate Names

Program Plan:

  • Include required header file.
  • Include required “std” namespace.
  • Define main function
    • Declare variable for input file.
    • Declare a variable “ns” in “set” template class of “string” type.
    • Open the given input file.
    • If the input file is fail, then the program terminates.
    • Otherwise, performs “while” loop. This loop executes until the end of file.
      • Declare a variable “name” in “string” type.
      • Read the name from given input file.
      • Then insert a name into “set” template class. If any duplicate name contains, then it remove that name.
    • Close the file.
    • Display statement.
    • Declare a variable “np” in constant iterator of “set” template class.
    • Display the names to generate the invitation list after removing duplicates names using “for” loop.

Blurred answer
Students have asked these similar questions
What is Windows Server and what is the Differences between Windows Server 2019 and the Windows Operating System that people have installed on their personal computer.
solve and show the tree on paper
I need help to resolve the following activity
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr