1st Assignment (Quarters)
1st Assignment (Quarters)
Semester # 02
Create a structure that stores the name, CNIC and sales data. The sales data is of 5 years in four
quarters. So the size of the sales should be 5 by 4. In main, create the array of employee that is of
size 3 and a function that source the sales rate of each employee according to the each quarter.
Create another function that displays the data of each employee.
Program:
// Class 1 (Quarters Program).cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
struct Employee{
string name;
int CNIC;
int sales[5][4];
};
void Data(Employee &e){
}
void Sales(int a[5][4]){
for(int i=0; i<4; i++){
cout<<" _________________________"<<endl;
cout<<"|Enter Sales for Quarter "<<i+1<<"|"<<endl;
cout<<" -------------------------"<<endl<<endl;
for(int j=0; j<5; j++){
cout<<"Sale "<<j+1<<": ";
cin>>a[j][i];
}
cout<<endl;
//Bubble Sorting
}
}
}
}
cout<<a[j][i]<<" ";
}
cout<<endl;
}
cout<<"_________________________________________________________"<<endl;
}
system("pause");
return 0;
}
Output:
The End…!!