// Lab 3 - SECJ1013 - 20211
// Group Members:
// 1. Ahmad Nazran bin Yusri
// 2. Megat Irfan Zackry bin Ismail
// 3. Muhammad Syazwan bin Sahdan

// 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.

#include <iostream>
#include <string>
#define SIZE 3

using namespace std;

int main(){
	string item[SIZE];
	float pricentax[3][2];
	
	for (int r = 0; r < SIZE; r++){
		cout << "Item " << r + 1 << " = ";
		cin >> item [r];
		cout << "Price " << r + 1 << " = RM";
		cin >> pricentax [r][1];
		cout << "Tax " << r + 1 << " = RM";
		cin >> pricentax [r][2];
		
		cout << "\n";
	}
	
	cout << "\n\n";
	cout << "Item \tPrice(RM) \tTax(RM) \tTotal Price(RM) \n";
    for (int r = 0; r < SIZE; r++){
    cout << item [r] << " \t" << pricentax[r][1] << "\t\t" << pricentax[r][2] << " \t\t" << (pricentax[r][1] + pricentax[r][2]) << "\n";
	}
}
