Answers
class Main
{
double total=0; int lowest;
Comic c[] = new Comic[2]; //array for comics
BoardGame b[] = new BoardGame[2]; //array for BoardGame
ActionFigure a[] = new ActionFigure[2]; //array for ActionFigure
c[0] = new Comic("Marvel",5,29.3); //initialize
c[1] = new Comic("DC",3,19.3);
b[0] = new BoardGame("Monopoly",25,629.3);
b[1] = new BoardGame("Business",15,529.3);
a[0] = new ActionFigure("Batman",6,829.3);
a[1] = new ActionFigure("Superman",12,1029.3);
a[0].setQuantity(12);
a[1].setQuantity(23);
b[0].setQuantity(3);
b[1].setQuantity(2);
c[0].setQuantity(123);
c[1].setQuantity(203); //initialization over
lowest = a[0].getPartNumber(); //initializing lowest
for (int i=0; i<a.size(); i++) //calculating total
total = total + a[i].getItemValue();
for (int i=0; i<b.size(); i++)
total = total + b[i].getItemValue();
for (int i=0; i<c.size(); i++)
total = total + c[i].getItemValue();
System.out.println("Total:\t"+total);
for (int i=0; i<a.size(); i++) //calculating lowest value
if(a[i].getItemValue()<lowest)
lowest = a[i].getItemValue();
for (int i=0; i<b.size(); i++)
if(b[i].getItemValue()<lowest)
lowest = b[i].getItemValue();
for (int i=0; i<c.size(); i++)
if(c[i].getItemValue()<lowest)
lowest = c[i].getItemValue();
}
COMMENT DOWN FOR ANY QUERIES AND,
LEAVE A THUMBS UP IF THIS ANSWER HELPS YOU.
.