Java Program that Specifies Four Parallel One-Dimensional Arrays

Sale-Receipt: Write a java program that specifies four parallel one-dimensional arrays to  

store the product name, quantity and cost-plus ItemTotal. Each array should be capable of  

holding a number of elements provided by user input. Using a for loop input values for length  

and width arrays. The entries in the area arrays should be the corresponding values for the  

product, which is to be used to calculate the costs as follows (thus, itemTotat[i] = quantity

[i]* cost [i]) after data has been entered display the following receipt as output:

Product Quantity Cost Total

———- ———– ——- ——–

Banana 4 2.65 10.60

coke 1 9.18 9.18

Sub-Total 19.78

VAT(15%) 2.97

TOTAL N$ 22.75

ample Run1

Enter the number of products: 2

Enter product 1 name, Qty and Cost: Banana 4 2.65

Enter product 1 name, Qty and Cost: Coke 1 9.18

Output1:

Product Quantity Cost Total

———- ———– ——- ——–

Banana 4 2.65 10.60

coke 1 9.18 9.18

Sub-Total 19.78

VAT(15%) 2.97

TOTAL N$ 22.75

Still stressed from student homework?
Get quality assistance from academic writers!