Question

DO NOT use #include <cstdlib> , iterate, and list. USE pointers and arrays. 1.Define a class...

DO NOT use #include <cstdlib> , iterate, and list. USE pointers and arrays.

1.Define a class named Family in a header file named: family.h (5 points) This file acts as a prototype.

2.Create the implementation file family.cpp (15 points total)

a.The class will have the following members

1.Family name (5 points)

2. Parent (array of 2) (5 points)

a.First Name

b.Last Name

c. Age (you must validate the age is the proper data type. You can use the code from Lab 4)

3. Children (array of 10) (5 points)

a.First Name

b.Last Name

c.Age (you must validate the age is the proper data type. You can use the code from Lab 4)

b. The class will be able to add parents or children

c. The class will be able to return information on parents and children.

3. Create the program Lab05b.cpp which uses the class Family to Implement the following

a.The program will allow the user to (14 points total)

1. Add families

a.With one or two parents (3 points)

b.With zero or more children (3 points)

2. Delete Families search by last name (should use the same search function from item 3 below. (1 point)

3.Display Families searching by last name (2 points)

4.Display a list of all families (5 points)

4. On exit print the following text to the screen; “ So long from the family!” where is the first family in the list (if the list is empty just print “ Bye Bye”). (1 point)

5. a.Be able to store data in a file C:\temp\family.dat when the program exits (5 points)

b. Be able to read the data from the file C:\temp\family.dat when the program starts. (5 points)

startup code for family.h:

#include

using namespace std;

struct FamilyName
{
   string firstName;
   string lastName;
   int age;
};

//*****use sizeof***

class Family
{
private:
   string FamilyMemberparents[2];
   string FamilyChildren[10];
   string familyName;

}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

yi #fyiclude fondly, h 米 氺 mt yroim (int argc, arg ly 5aft ch (m)veak boeak Case 3 . ave u ase boeakİfndef FAMILY-H 非defhe FAMILY-H typedef gyutt 3 chalaren brent ponent (j23;upirc9tarent enΥγ2tCruk <<ץ Age. <<V- frafly[rj.ckkren C1] elsc

Add a comment
Know the answer?
Add Answer to:
DO NOT use #include <cstdlib> , iterate, and list. USE pointers and arrays. 1.Define a class...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Java programming question: Here is the feedback I received "sort fails. Use Arrays class method to...

    Java programming question: Here is the feedback I received "sort fails. Use Arrays class method to sort." The actual question: Write a program as follows: Declare a five element array of Strings. Use a for loop and keyboard input to populate the array with the names of five friends. Sort the array in alphabetical order. Use a foreach loop to print the sorted array of friends, all on one line. Sample Output (inputs in italics) Enter the names of five...

  • Define a class StatePair with two template types (T1 and T2), a constructor, mutators, accessors

     13.5 LAB: Zip code and population (class templates) Define a class StatePair with two template types (T1 and T2), a constructor, mutators, accessors, and a Printlnfo0 method. Three vectors have been pre-filled with StatePair data in main: . vector<StatePair <int, string>> zipCodeState: ZIP code - state abbreviation pairs . vector<StatePair<string, string>> abbrevState: state abbreviation - state name pairs • vector<StatePair<string, int>> statePopulation: state name - population pairs Complete mainO to use an input ZIP code to retrieve the correct state abbreviation from the vector zipCodeState. Then use...

  • Write in C++ 1. Use the following Person class (Person.cpp, Person.h). You will be writing Person...

    Write in C++ 1. Use the following Person class (Person.cpp, Person.h). You will be writing Person objects to a random access file. --------------------- Person.cpp--------------------------------- // Class Person stores customer's credit information. #include <string> #include "Person.h" using namespace std; // default Person constructor Person::Person( int idValue, string lastNameValue, string firstNameValue, int AgeValue ) { setID( idValue ); setLastName( lastNameValue ); setFirstName( firstNameValue ); setAge( AgeValue ); } // end Person constructor // get id value int Person::getID() const { return id;...

  • For this assignment, you will use your knowledge of arrays and ArrayLists to write a Java...

    For this assignment, you will use your knowledge of arrays and ArrayLists to write a Java program that will input a file of sentences and output a report showing the tokens and shingles (defined below) for each sentence. Templates are provided below for implementing the program as two separate files: a test driver class containing the main() method, and a sentence utilities class that computes the tokens and shingles, and reports their values. The test driver template already implements accepting...

  • VISUAL BASIC- create a program for managing a "To Do" list. The program will need to...

    VISUAL BASIC- create a program for managing a "To Do" list. The program will need to read and update a text file named ToDoList.txt. The record structure of the file must be: 1) sort order, 2) task name and 3) desired completion date. When the program starts, it should read the contents file into a structure. The information should then be displayed in a data grid view. The data should be initially sorted by the sort order value. Afterwards, the...

  • Please help me with FLOWCHART and UML diagram for class, thank you! #include <iostream> #include <fstream>...

    Please help me with FLOWCHART and UML diagram for class, thank you! #include <iostream> #include <fstream> #define MAX 10 using namespace std; class WordListTree { public:    // Structure of a node    struct Node {        string key;        // Create an array of up to MAX children        Node* child[MAX];    };    // Create a tree of strings    Node* newNode(string key) {        Node* temp = new Node;        (*temp).key =...

  • USING THIS CODE: #include <iostream> #include <string> using namespace std; class Contact { //this class cannot...

    USING THIS CODE: #include <iostream> #include <string> using namespace std; class Contact { //this class cannot be viewed from outside of the private class. //only the class functions within the class can access private members. private: string name; string email; string phone; //the public class is accessible from anywhere outside of the class //however can only be within the program. public: string getName() const { return name; } void setName(string name) { this->name = name; } string getEmail() const {...

  • Using loops with the String and Character classes. You can also use the StringBuilder class to...

    Using loops with the String and Character classes. You can also use the StringBuilder class to concatenate all the error messages. Floating point literals can be expressed as digits with one decimal point or using scientific notation. 1 The only valid characters are digits (0 through 9) At most one decimal point. At most one occurrence of the letter 'E' At most two positive or negative signs. examples of valid expressions: 3.14159 -2.54 2.453E3 I 66.3E-5 Write a class definition...

  • Using Python. 3) Create a single-linked list (StudentList) where the data in the link is an object of type pointer to Student as defined below. Note that you need to store and pass a pointer of type...

    Using Python. 3) Create a single-linked list (StudentList) where the data in the link is an object of type pointer to Student as defined below. Note that you need to store and pass a pointer of type Student so that you do not create duplicate objects. Test your list with the provided program. You will find example code for a single-linked list of integers in Moodle that you can base your solution on. For your find methods, you can either...

  • Must be in Python 3 exercise_2.py # Define the Student class class Student():    # Ini...

    Must be in Python 3 exercise_2.py # Define the Student class class Student():    # Initialize the object properties def __init__(self, id, name, mark): # TODO # Print the object as an string def __str__(self): return ' - {}, {}, {}'.format(self.id, self.name, self.mark) # Check if the mark of the input student is greater than the student object # The output is either True or False def is_greater_than(self, another_student): # TODO # Sort the student_list # The output is the sorted...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT