I am needing some help with a C++ Assignment. I created an address book in an ea
ID: 3559472 • Letter: I
Question
I am needing some help with a C++ Assignment. I created an address book in an earlier assignment, but now it is asking me to use the same code, BUT redo it so that the address book is actually stored in a vector. I am falling apart here and need some serious help. I have been glaring at the screen for 2 hours and am stuck. I kind of understand the vector concept, but not sure how to make it work from scratch. The assignments in this class are way too difficult. Here is the code that I have from the first assignment:
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
}
?
class addressType
{
private :
char Name[500];
long ph_num;
char Address[500];
int Year;
int Month;
int Day;
char Type;
int FM,F,B;
char Family,Friend,Business;
public:
addressType();
void setName();
void getName();
void getphone();
long setphone();
void setAddress();
void getAddress();
float getAverage();
int setDay();
void addressType::getDay()
{
cout<<" BIRTH DAY : "<<Day<<"/";
}
?
int setMonth();
void getMonth();
int setYear();
void getYear();
char setType();
?
void getType();
};
?
class personType
{
public:
void print() const;
//Function to output the first name and last name
void setName(string first, string last);
//Function to set firstName and lastName
?
string getFirstName() const;
//Function to return the first name.
string getLastName() const;
?
personType(string first = "", string last ="");
?
private:
string firstName; //variaable to store the first name
string lastName; //variable to store the last name
};
?
?
?
class dateType
{
public:
void setDate (int month, int day, int year);
int getDay() const;
//Function to return the day.
int getMonth() const;
//Function to return the month.
int getYear() const;
//Function to return the year.
void printDate() const;
//Function to output the date in the form mm-dd-yyyy.
dateType(int month = 1, int day = 1, int year = 1900);
//constructor to set the date
private:
int dMonth; //variable to store the month
int dDay; //variable to store the day
int dYear; //variable to store the year
};
Explanation / Answer
i think the code is O.K. what s your problem exactly.
hope this helps you. try it.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.