Answer:
Explanation:
import java.util.Array;
public class Items{
public static void main (String {} args){
// a. Set up 4 arrays which hold data about 6 items you want to sell
int [] itemnum = new int[](1,2,3,4,5,6);
int [] quantity = new int[](500,200,350,100,270,300);
double [] price = new double [](10000, 50000,30000, 22000, 26000,100200);
double[] sales = new double [6];
//b. Set up loops to load the itemnum, quantity and price arrays
for(int I=0;I<6;I++)
{
System.out.println("Item "+itemnum[I]);
System.out.println("Item "+quantity[I]);
System.out.println("Item "+price[I]);
}
//c. Set up another loop to calculate values for the sales array.
for(int j=0;j<6;j++)
{
sales[j] = quantity[j] * price[j];
}
//d. Set up another loop to print the item number and sales amount for each transaction
for(int k=0;k<6;k++)
{
System.out.println("Item Number "+itemnum[k]);
System.out.println("Sales Amount "sales[k]);
}
//e. Set up another loop to calculate the total sales of all 6 items
double totalsales = 0;
for(int l=0;l<6;l++)
{
totalsales+=sales[l];
}
//f. print the total sales amount
System.out.print("Total Sales: "+totalsales);
}
}