View Single Post
Old Nov 19th, 2007, 7:26 PM   #1
AlexN
Newbie
 
Join Date: Nov 2007
Posts: 2
Rep Power: 0 AlexN is on a distinguished road
Pascal assignment help

Hey guys im new here...

i need to make a program that estimates the costs of the following:


Materials


Ceiling: xx.x litres @ x.xx per litre 99.99
walls: xx.x litres @ x.xx per litre 999.99
xx rolls of paper @ xx.xx per roll 999.99
woodwork: xx.x litres @ x.xx per litre 99.99


Sub Total 999.99

VAT @ 17.5% 99.99

Final total 999.99


Request the inputs and use them to produce the estimate in the required format(see above).
Assume the following:


- each door occupies 2 square metres and requires 1 litre of paint
- each window occupies 2 square metres but requires only 0.5 litres of paint
- emulsion paint gives a coverage of 8 squre metres per litre
- emulsion paint costs £3.50 per litre
- Gloss paint gives a coverage of 6 square metres per litre
- gloss paint gives £4.00 per litre
- Wall paper rolls are 1m by 10m
- note: walls are either painted or wallpapered, not both
gloss paint is used on woodwork, emulsion everywhere else
paint is covered in 1 coat

repeat process untill there are no more estimates


the main thing im having trouble with is the structure of it.... how would you guys structure said assignment this is what i have so far:

program Estimator;

var

height, width, length : real;
Ceiling, walls : real;
Paint1, Paint2 : real;
Cust: integer;
Litres1 : integer;
Litres2 : integer;
paperolls : integer;
doors : integer;
windows : integer;
Vat : real;
Total : real;


begin (* Main *)
writeln ('Joe Blakes Painting & Decorating Tel: 01522 522522');
readln;
writeln <'Enter the Customers name:'>;
readln<Cust>;
writeln <'Please Enter the dimensions of the room'>;
readln;
writeln<'Enter the height in metres:'>;
readln<height>;
write<'Enter the width in metres:'>;
readln<width>;
write<'Enter the length in metres:'>;
readln<length>;
Ceiling:=width*length;
paint1:=ceiling/8;
walls:=<length + width>*2*height;
paint2:= walls/6;
writeln<'ceiling needs',paint1:0:1,'litres');
write<'walls need',paint2:0:1,'litres');
end;

begin

litres1 := 03.50
litres2 := 04.00

end.

Last edited by DaWei; Nov 19th, 2007 at 8:32 PM. Reason: Added code tags. Read the rules.
AlexN is offline   Reply With Quote