# Answer to Question #8694 in Delphi | Pascal for berry

Question #8694
write a pascal Program with procedure called Calculatediscount that caluculates the actual discounted price based on the day number input. the program must output the corrisponding day of the week and the price for the day?
1
2012-04-27T07:55:24-0400
Program calculates discount depending on day of week. User inputs day number from 1 to 7 and price. Output data is day from Monday to Sunday and calculated price.
price=(10-daynumber)/10*price. It means that Monday(10%),Tuesday(20%) &hellip; For example
day=5 price =120 output: Friday 60.

program discount;
var day :real; price :real;
procedure calculatediscount(day:real;price:real);
var c:string;
begin
if day=1 then c:=&#039;Monday&#039; else if
day=2 then c:=&#039;Tuesday&#039; else if
day=3 then c:=&#039;Wednesday&#039; else if
day=4 then c:=&#039;Thursday&#039; else if
day=5 then c:=&#039;Friday&#039; else if
day=6 then c:=&#039;Saturday&#039; else if
day=7 then c:=&#039;Sunday&#039;;

price:=(10-day)/10*price;
writeln(&#039;on &#039;,c,&#039; price is &#039;,price);
end;
begin
writeln(&#039;enter a day from monday=1 to sunday=7 and price&#039;);
calculatediscount(day,price);
end.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!