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
  • 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...

  • For C++ This is the information about the meal class 2-1. (24 marks) Define and implement...

    For C++ This is the information about the meal class 2-1. (24 marks) Define and implement a class named Dessert, which represents a special kind of Meal. It is to be defined by inheriting from the Meal class. The Dessert class has the following constructor: Dessert (string n, int co) // creates a meal with name n, whose type // is "dessert" and cost is co The class must have a private static attribute static int nextID ; which is...

  • Trying to practice this assignment Argument list: the *yahoonews.txt Data file: yahoonews.txt Wr...

    Trying to practice this assignment Argument list: the *yahoonews.txt Data file: yahoonews.txt Write a program named WordCount.java, in this program, implement two static methods as specified below: public static int countWord(Sting word, String str) this method counts the number of occurrence of the word in the String (str) public static int countWord(String word, File file) This method counts the number of occurrence of the word in the file. Ignore case in the word. Possible punctuation and symbals in the file...

  • Homework 3: Input Validation 1   Objectives control structures console-based user input using Scanner class writing complete...

    Homework 3: Input Validation 1   Objectives control structures console-based user input using Scanner class writing complete programs using two classes: client and supplier 2   User Interface Specification This is a console-based I/O program. Display should go to System.out (print or println) and the program will get user input using the Scanner class. The flow of execution should be as follows: When the program starts, display a one-line introduction to the user Display a menu with 5 options 1. validate zip...

  • 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...

  • Parallel Arrays Summary In this lab, you use what you have learned about parallel arrays to...

    Parallel Arrays Summary In this lab, you use what you have learned about parallel arrays to complete a partially completed Java program. The program should either print the name and price for a coffee add-in from the Jumpin’ Jive coffee shop or it should print the message: "Sorry, we do not carry that.". Read the problem description carefully before you begin. The data file provided for this lab includes the necessary variable declarations and input statements. You need to write...

  • I've done all questions except question 6. how do I do this? please help. code needs...

    I've done all questions except question 6. how do I do this? please help. code needs to be java 1. You need to be able to open and read the text files that have been provided for the project. Write a Java program that reads the driver.txt file and displays each data value for each line from the file to the screen in the following format: Licence Number: Licence Class: First Name: Last Name: Address: Suburb: Postcode: Demerit Points: Licence...

  • 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...

  • (JAVA) Use the Pet.java program from the original problem (down below) Compile it. Create a text...

    (JAVA) Use the Pet.java program from the original problem (down below) Compile it. Create a text file named pets10.txt with 10 pets (or use the one below). Store this file in the same folder as your “class” file(s). The format is the same format used in the original homework problem. Each line in the file should contain a pet name (String), a comma, a pet’s age (int) in years, another comma, and a pet’s weight (double) in pounds. Perform the...

  • 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 {...

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
ADVERTISEMENT