Pres
New Coder
ive changed all the untils possible to ; and still doesnt work
Code:
Program CheckoutCounter;
var
customerID: integer;
loyaltyPoints, finalPrice, loyaltyPointsEarned, totalLoyaltyPoints, discount, itemPrice: real;
begin
writeln('Enter customer ID:');
readln(customerID);
writeln('Enter loyalty points:');
readln(loyaltyPoints);
finalPrice := 0;
repeat
writeln('Enter price of next item (enter -1 to stop):');
readln(itemPrice);
if itemPrice <> -1 then
begin
finalPrice := finalPrice + itemPrice;
end;
until itemPrice = -1;
loyaltyPointsEarned := finalPrice * 0.2;
totalLoyaltyPoints := loyaltyPoints + loyaltyPointsEarned;
if finalPrice > 1500 then
begin
discount := finalPrice * 0.1;
end
else
begin
discount := 0;
end;
discountedFinalPrice := finalPrice - discount;
writeln('Customer ID: ', customerID);
writeln('Loyalty points earned in this transaction: ', loyaltyPointsEarned:0:2);
writeln('Total amount of loyalty points: ', totalLoyaltyPoints:0:2);
writeln('Bill before discount: ', finalPrice:0:2);
writeln('Discount given: ', discount:0:2);
writeln('Final bill: ', discountedFinalPrice:0:2);
end.