Is that exercise 3.6?
You want the program to read in the length and width into two separate variables.
Then because there's going to be a 1m border around the garden, where there's not gonna be any grass you want to minus 2 off of the width, and minus 2 off of the length.
Then just multiply these 2 numbers to get the area.
Then just do 10*area- to get how much its gonna cost.
so basically
GardenArea:=(width-2)*(height-2);
Totalcost:=GardenArea*10;
Im not that far yet, but that will be helpful when I get there!
Im on the farenheit to celsius converter, but im getting an error when I try to compile it. Heres my code that im trying:
var
Degreesfarenheit, Cels, Farenheit : Integer;
begin
Write ('Please Input Temperature in Farenheit: ');
Readln (Degreesfarenheit);
Farenheit := Degreesfarenheit - 32;
Cels := Farenheit * (5/9);
Write ('Temperature is: ', Cels , ' Degrees Celsius');
Readln
end.
I get a red line over the cels := Farenheit * (5/9); line I assume because of something to do with the way the program displays decimal places. I know I need to declare a variable as a real number to display it right, but what do I need to declare? Also, how do I work in the 'Write (answer:5:2); command for the decimal places?
Im trying my best not to revert to any of the answers until I can get at least in the ballpark for the answer. So far up till this point i have not needed to check anything...