C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 14, Problem 14.10E

Write a series of statements that accomplish each of the following. Assume that we've defined class Person that contains the private data members
char lastName[15];
char firstName [10]:
int age;
int id;
and public member functions
// accessor functions for id
void set Id(int);
int getId() const;
// accessor functions for lastName
void setLastName (const string&);
string getLastName() const;
// accessor functions for firstName
void setFirstName(const string&);
string getFirstName() const;
// accessor functions for age
void setAge (int);
int getAge() const;
Also assume that any random-access files have been opened properly.

  1. Initialize nameage.dat with 100 records that store values lastName =”unassigned”, firstName = “” and age = 0.
  2. Input 10 last names, first names and ages, and write them to the file,
  3. Update a record that already contains information. If the record does not contain information, inform the user "No info".
  4. Delete a record that contains information by reinitializing that particular record.

Blurred answer
Students have asked these similar questions
The distinction between a class's static and non-static data members is as follows: Give an example of real-world application where you think a static data member would be useful.
Programming Exercise 11-2 dateType.h file provided   #ifndef date_H  #define date_H   class dateType { public:     void setDate(int month, int day, int year);       //Function to set the date.       //The member variables dMonth, dDay, and dYear are set        //according to the parameters       //Postcondition: dMonth = month; dDay = day;       //               dYear = year      int getDay() const;       //Function to return the day.       //Postcondition: The value of dDay is returned.     int getMonth() const;       //Function to return the month.         //Postcondition: The value of dMonth is returned.     int getYear() const;       //Function to return the year.            //Postcondition: The value of dYear is returned.     void printDate() const;       //Function to output the date in the form mm-dd-yyyy.     bool isLeapYear();       //Function to determine whether the year is a leap year.     dateType(int month = 1, int day = 1, int year = 1900);       //Constructor to…
Please circle True or False for each of the following statements. C++ A private data member is only accessible through its class’s member functions.    TRUE  FALSE
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
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
What is Abstract Data Types(ADT) in Data Structures ? | with Example; Author: Simple Snippets;https://www.youtube.com/watch?v=n0e27Cpc88E;License: Standard YouTube License, CC-BY