C++ How To Program Sve & Mpl W/pe Etx A/c
C++ How To Program Sve & Mpl W/pe Etx A/c
1st Edition
ISBN: 9780134612386
Author: Deitel
Publisher: Pearson Education
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
Write a program that does the following: 1-Define two classes Teacher and Department. Each Teacher has a department object as follow: [3 points] class Department{ int dno; char *name; //add data member to count number of departments automatically public: //add required methods here //define print function that prints all details of department. Note that print function is NOT function member of class Department }; class Teacher{ const int SSN; char *name; Department d; public: //add all required methods //define print function that prints all details of Teacher. Note that print function is NOT function member of class Teacher } 2-inside main do the following: a) create array of 5 Teachers. add all required details for each object inside a loop.(do NOT use cin>>) b)use print function for department and use print function for student. c)define and use a function FindTeachers that takes the array of Teachers and name of department. Then the function returns a list of all Teachers…
NEED A PROGRAM CODE IN C++ IN VISUAL SRUDIO WITH OUTPUT Write a program to overload the * operator for multiplying a Distance class object with a floating point number. The Distance class should have meters and kilometres as data members. Add all appropriate member functions for the program to work properly. In addition, write the main function to test your class as follows:   int main() {     Distance dist(700, 2);     dist= dist * 2;     dist = 2 * dist;    dist.display();     return 0; }
Write a program in java a class Box having three private data members (width, depth, height) The class has three constructors which are having no parameter – for setting values to zero or null. having three parameters for assigning values to height, width, depth respectively. Overload the above constructor and use this keyword to set the values of width, height & depth. Provide getters/setters for data members. Write a function calculateVolume() which calculates the volume of the box.   Write test Application that demonstrates the Box class by calling all the three constructors and method, creating a Create Box object, and then displaying the Box’s width , height, length and volume
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++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
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