program PurchaseCost;
varnumNotebooks, numPens, numPencils: integer;priceNotebook, pricePen, pricePencil: real;totalCost: real;
beginwrite('Enter the number of notebooks: ');readln(numNotebooks);write('Enter the price of one notebook: $');readln(priceNotebook);
write('Enter the number of pens: ');readln(numPens);write('Enter the price of one pen: $');readln(pricePen);
write('Enter the number of pencils: ');readln(numPencils);write('Enter the price of one pencil: $');readln(pricePencil);
totalCost := (numNotebooks priceNotebook) + (numPens pricePen) + (numPencils * pricePencil);
writeln('The total cost of the purchase is: $', totalCost:0:2);
end.
program PurchaseCost;
var
numNotebooks, numPens, numPencils: integer;
priceNotebook, pricePen, pricePencil: real;
totalCost: real;
begin
write('Enter the number of notebooks: ');
readln(numNotebooks);
write('Enter the price of one notebook: $');
readln(priceNotebook);
write('Enter the number of pens: ');
readln(numPens);
write('Enter the price of one pen: $');
readln(pricePen);
write('Enter the number of pencils: ');
readln(numPencils);
write('Enter the price of one pencil: $');
readln(pricePencil);
totalCost := (numNotebooks priceNotebook) + (numPens pricePen) + (numPencils * pricePencil);
writeln('The total cost of the purchase is: $', totalCost:0:2);
end.