// Lab 3 - SECJ1013 - 20211
// Group Members:
// 1. Amirul Iman bin Ahmad Keflee
// 2. Muhammad Amiruddin bin Zulkifli
// 3. Muhammad Faiz Aiman bin Fakhrurrazi

// Study and identify the issues of the below program. Improve 
// the source code of the program so the solutions can be made 
// in a more systematic and efficient ways by using parallel 
// and multidimensional arrays.

#define COLUMN 3

#include <iostream>
#include <string>

using namespace std;

int main() {
	string item[3];
	float price[3];
	float tax[3];
	float total[3];
	
	for (int i = 0; i < 3; i++){
		cout<<"Item: ";
		cin>>item[i];
		cout<<"Price: ";
		cin>>price[i];
		cout<<"Tax: ";
		cin>>tax[i];
		cout<<"\n";
	}
	
	for (int i = 0; i < 3; i++){
		total [i] = price[i] + tax[i];
	}
	
	cout<<"Item. \tPrice \tTax \tTotal Price\n";
	for (int i = 0; i < COLUMN; i++){
		cout<<item[i]<<" \t" << price[i] << " \t" << tax[i] << " \t" << total[i] << "\n";
	}
}
