Professional Documents
Culture Documents
MTS3063 (B) - Group 3 Assignment Project
MTS3063 (B) - Group 3 Assignment Project
PRINSIP PENGATURCARAAN
ASSIGNMENT
(GROUP PROJECT)
GROUP: B
PROVIDED:
NAME MATRIC NO
IZZUDDIN BIN ISHAK D20191088261
BALKIS BINTI ABDULLAH D20191087773
SITI NUR ALLIA BINTI SHAHUDI D20191087895
MOHD LOQMAN BIN TAMMIM D20172080284
//Array
const int SIZE = 10;
string IC[SIZE];
string name[SIZE];
int salary[SIZE],no_loan[SIZE], loan_payment[SIZE];
int i=0;
string type[SIZE];
char cont;
//function
int personal_info(string, string, int, int, int);
void eligibility_cust();
void menu_company();
void output_file();
//*******************************************************
// Function main *
//*******************************************************
int main ()
{
// for display
cout << "***************************************"<<endl;
cout << "ABC FINANCING COMPANY"<< endl;
cout << " "<<endl;
cout << "List of customers' personal informations"<< endl;
cout << " "<<endl;
personal_info(name[i], IC[i],
salary[i],no_loan[i],loan_payment[i]);
cout << " "<<endl;
eligibility_cust();
cout << " "<<endl;
menu_company();
cout << " "<<endl;
output_file();
cout << " That's all, thank you!";
cout << "\n***************************************";
}
//*******************************************************
// Definition of function personal_info *
// This function displays a data from the input file *
//*******************************************************
//*********************************************************
// Definition of function eligibility_cust *
// This function displays the eligibility of each customer*
//*********************************************************
void eligibility_cust()
{
//Array with the eligibility for each type of cards
string type_of_cards[3]={ "Eligibility for Platinum Card",
"Eligibility for Gold Card", "Eligibility for Silver Card"};
void menu_company()
{
int choice, salary, loan_payment;
double balance;
if(choice == 1)
{
cout<<"\n Nickname "<<" IC Number "<<" Balance from
salary "<<endl;
cout<<" Ali "<<" 851207-02-7762 "<<" RM30000 \n"<<endl;
}
else if (choice == 2)
{
cout<<"\n Nickname "<<" IC Number "<<" Balance from
salary "<<endl;
cout<<" Ali "<<" 851207-02-7762 "<<" RM30000 "<<endl;
cout<<" Afrina "<<" 851205-07-6734 "<<" RM15000
\n"<<endl;
}
else if (choice == 3)
{
cout<<"\n Nickname "<<" IC Number "<<" Balance from
salary "<<endl;
cout<<" Ali "<<" 851207-02-7762 "<<" RM30000 "<<endl;
cout<<" Afrina "<<" 851205-07-6734 "<<" RM15000
\n"<<endl;
}
else if (choice == 4)
{
cout<<"\n EXIT \n"<<endl;
}
//*********************************************************
// Definition of function output_file *
// This function is to store information *
//*********************************************************
void output_file()
{
fstream outfile;
outfile.open("outputm.txt", ios::out);
if (!outfile) {
cout << "File not created!";
}
else {
cout << "File created successfully!";
for (int i = 0; i<10; i++){
outfile <<left<<" "<< IC[i] <<left <<" "<<
type[i]<<endl;
}
outfile.close();
}
}
2. Input and output file.
Input file (inputm.txt)
851205-07-6734 AFRINA 17000 1 2000
851207-02-7762 ALI 40000 1 10000
801112-02-3421 SYAKILA 4000 1 1000
Output file (outputm.txt)
851205-07-6734 G
851207-02-7762 P
801112-02-3421 N
851205-07-6734 S
851207-02-7762 S
851207-02-7762 G
3. Example of output. (use print screen)