Absolute C++
Absolute C++
6th Edition
ISBN: 9780133970784
Author: Walter Savitch, Kenrick Mock
Publisher: Addison-Wesley
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 8, Problem 4PP

Cumulatively modify the example from Display 8.7 as follows.

  1. In Display 8.7, replace the private char members first and second with an array of char of size 100 and a private data member named size. Provide a default constructor that initializes Size to 10 and sets the first 10 of the char positions to • . (This only uses 10 of the possible 100 slots.) Provide an accessor function that returns the value of the private member size.
  2. Test.

  3. Add an operator member that returns a char& that allows the user to access or to set any member of the private data array using a non-negative index that is less than size.
  4. Test.

  5. Add a constructor that takes an int argument, sz, that sets the first sz members of the char array to ' # '.
  6. Test.

  7. Add a constructor that takes an int argument, sz, and an array of char of size sz. The constructor should set the first sz members of the private data array to the sz members of the argument array of char.
  8. Test.

NOTES: When you test, you should test with known good values, with data on boundaries and with deliberately bad values. You are not required to put checks for index out of bounds errors in your code, but that would be a nice touch. Error handling alternatives: Issue an error message then die (that is, call exit (1)) or give the user another chance to make a correct entry.

Blurred answer
Students have asked these similar questions
a database with multiple tables from attributes as shown above that are in 3NF, showing PK, non-key attributes, and FK for each table? Assume the tables are already in 1NF. [Hint: 3 tables will result after deducing 1NF -> 2NF -> 3NF]
a database with multiple tables from attributes as shown above that are in 3NF, showing PK, non-key attributes, and FK for each table? Assume the tables are already in 1NF. [Hint: 3 tables will result after deducing 1NF -> 2NF -> 3NF]
If a new entity Order_Details is introduced, will it be a strong entity or weak entity? If it is a weak entity, then mention its type (ID or Non-ID, also Justify why)?

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
In Exercises 41 through 46, identify the errors.

Introduction To Programming Using Visual Basic (11th Edition)

This operator can be used to determine whether a reference variable references an object of a particular class....

Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)

Determine the force in each member of the truss, and state if the members are in tension or compression Set = ...

INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)

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
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
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
9.1: What is an Array? - Processing Tutorial; Author: The Coding Train;https://www.youtube.com/watch?v=NptnmWvkbTw;License: Standard Youtube License