Answer:
Explanation:
The following program is written in Java. Using the program code from Purchase class in 5.13 I created each one of the fruit objects. Then I set the price for each object using the setPrice method. Then I set the number of each fruit that I intended on buying with the setNumberBought method. Finally, I called each objects getTotalCost method to get the final price of each object which was all added to the totalCost instance variable. This instance variable was printed as the total cost of the bill at the end of the program. My code HIGHLIGHTED BELOW
//Entire code is in text file attached below.
//MY CODE HERE
DecimalFormat df = new DecimalFormat("0.00");
oranges.setPrice(10, 2.99);
oranges.setNumberBought(2*12);
eggs.setPrice(12, 1.69);
eggs.setNumberBought(2*12);
apples.setPrice(3, 1);
apples.setNumberBought(20);
watermelons.setPrice(1, 4.39);
watermelons.setNumberBought(2);
bagels.setPrice(6, 3.50);
bagels.setNumberBought(12);
totalCost = oranges.getTotalCost() + eggs.getTotalCost() + apples.getTotalCost() + watermelons.getTotalCost() + bagels.getTotalCost();
System.out.println("Total Cost: $" + df.format(totalCost));
}
}
<span>Ctrl + Q - show all tabs
Ctrl + O - open a file
Ctrl + T - Open a New Tab
Ctrl + W - close a tab
Hope This Helped <3
</span>
<span>It is generally a good idea to set the font size to at least 30 points in presentations </span><span>to ensure readability even from a distance.</span>
English:
Recycling, in general, is good, it saves space in landfills and prevents pollution. Because some of the materials used to make the electronic piece are made with toxic ingredients its better to recycle them instead of having them end up in our oceans. Also, some pieces of electronics contain valuable metals like gold and copper. These Metals can be reused to make new better electronics with having to use the energy and money to produce new materials
Español:
El reciclaje, en general, es bueno, ahorra espacio en los vertederos y evita la contaminación. Debido a que algunos de los materiales utilizados para fabricar la pieza electrónica están hechos con ingredientes tóxicos, es mejor reciclarlos en lugar de que terminen en nuestros océanos. Además, algunos componentes electrónicos contienen metales valiosos como el oro y el cobre. Estos metales se pueden reutilizar para fabricar nuevos y mejores productos electrónicos con la necesidad de utilizar la energía y el dinero para producir nuevos materiales.