Please.How to declare data fields?...accessors and mutators which will keep track of the total year-to-date purchases?

In my program I am modifying my customer class ... the question goes as follows.

suppose that the customer class is going to be expanded to keep track of total year-to-date purchases.

- declare data fields, accessors and mutators which will keep track of the total number of sales and total sales for each instance of customer.

would the data fields be functions? and should the data fields, accessors, and mutators be all defined in like a definition statement. I really want to make sure I'm on the right track with this assignment. Can you explain what i should do and give a program example... that would really help me.. my code thus far is below...


#include <cstdlib>
#include <iostream>

class Customer
Customer( string name, string address, string city, string state,
string zipcode);

void increase_limit(double amount);
string get_name() const;
string get_address() const;
string get_city() const;
string get_state() const;

string name;
string address;
string city;
string state;
string zipcode;
double credit_limit;

}; // End class Customer.
using namespace std;

int main()
// Testing Customer class.
Customer string ( name, address, city, state, zipcode);

cout<<"Customer name: "<<string.get_name()<<endl;
cout<<"Customer address: "<<string.get_address()<<endl;
cout<<"Customer city: "<<string.get_city()<<endl;
cout<<"Customer state: "<<string.get_state()<<endl;
cout<<"Customer zipcode: "<<string.get_zipcode()<<endl;

return 0; //indicates success
}// end of main


*** it also says to write a program that tests the features of the customer class so im basically testing within the program.
Topic archived. No new replies allowed.