C++ Classes Assignment Help

I need help beginning this program, I am in intro to c++ course. I need help with how to begin the program. I have done some thing already. The program is:

- define class cust(I already did this part)
- create an array of cust (size 10)to hole the data of the class.
- read the date from a file(everything from the class)
- call a function print cust(this function will print all the data in tabular format)....first, last, state, sales history(0,1,2), units

Here is the code:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

class cust{
string first;
string last;
string state;
double arr[3]; //Sales history for three years
int units;
int total;
} ;

int main()
cust customer[10];
int i;

for(int i=0;i<10;i++)
cust customer[i];

ifstream infile;

getline(infile, customer[i].last);
getline(infile, customer[i].state);


void printcust(int a[], int m, string f, string l, string s, double ar[], int u){

int i;

cout<<"First"<<"\t\tLast"<<"\t\tState"<<"\t\tSales History"

for(int i=0;i<m;i++)

Last edited on
1) Please use code tags when posting code, to make it readable:


2) Can you be more specific about what it is you're having trouble understanding?
Topic archived. No new replies allowed.