Cash Register
March 1, 2010{Use PascalIDE to execute this program}
{Cash Register}
program CustomerOrder;
uses crt;
var fname,lname:string;
i:integer;
order:array[1..5] of real;
cash:integer;
total:real;
change:real;
begin
i:=0;
cash:=0;
clrscr;
writeln(’>>> Name of your store <<<’);
writeln(’>>> Your Address here <<<’);
writeln(’>>> 123-45-67 <<<’);
writeln(’>>> email_me@yahoo.com <<<’);
writeln(’ Press “c” to continue : ‘);
readln;
writeln(’Customer’);
writeln(’First name: ‘);
readln(fname);
writeln(’Last name: ‘);
readln(lname);
writeln(’Menu’);
writeln(’1.apple ……… 5.00′);
writeln(’2.orange……… 10.00′);
writeln(’3.grapes……… 15.00′);
writeln(’4.banana……… 10.00′);
writeln(’5.coconut…….. 15.00′);
{price}
for i:= 1 to 5 do begin
writeln(’Order ‘,i,’:');
readln(order[i]);
end;
{price}
writeln(’—————-’);
writeln(’Official Receipt’);
writeln(’—————-’);
writeln(’Customer: ‘,fname,’ ‘,lname);
total:= 0.00;
for i:= 1 to 5 do begin
writeln(’Price ‘,i,’:',order[i]:7:2);
total:=total + order[i];
end;
writeln(’—————’);
writeln(’Total: ‘,total:7:2);
writeln(’—————’);
write(’Cash: ‘);
readln(cash);
change:=0.00;
change:=cash - total;
writeln(’—————’);
writeln(’Change: ‘,change:7:2);
writeln(’—————’);
readln;
end.
All comments are moderated. Your comments will not appear here unless approved by the blog owner. Thank you.


