Data structures and algorithms in C++
Data structures and algorithms in C++
2nd Edition
ISBN: 9780470460443
Author: Goodrich
Publisher: WILEY
Question
Book Icon
Chapter 2, Problem 8C
Program Plan Intro

Simulation of an Internet application

Program plan:

  • Declare the header files and namespace.
  • Create a class “Bob”,
    • Declare variable.
    • Declare the public access modifier.
    • Define the constructor “Bob()”,
      • Set the initial value
      • Print the receiving message.
    • Define the destructor “Bob()”,
      • Print the destroyed message.
  • Create a class “InternetProc”,
    • Declare the public access modifier.
    • Define the constructor “InternetProc()”,
      • Call the constructor “Bob()”.
  • Create a class “Alice”,
    • Declare the public access modifier.
    • Define the constructor “Alice()”,
      • Call the constructor “InternetProc()”.
  • Define the “main()” method,
    • Declare and initialize the variable.
    • Execute while the value of count is greater than “0”,
      • Call the constructor “Alice()”.
      • Decrement the counter variable.
    • Return “0”.

Blurred answer
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education