in my program a simple shopping application for my lab exercise, i just calculated the price of items inside a for loop but when i try to print it outside it is not getting printed...pls give me some suggestion.
for (int i = 1; i < 7; i++) {
String selection = request.getParameter("a" + i);
if (selection.equals("l")) {
price = Integer.parseInt(request.getParameter("b" + i));
total = total + price;
out.println("<h3>You have purchased the item:<br>Price is:</h3>" + price);
}
}
out.println("THE TOTAL IS"+total);
out.println("</body>");
out.println("</html>");