Hi can anyone tell me how to get the region sales to calculete the whole 8 inputs? What it seems is happening is the a integer is repeating untill 8 but that the program stops at 8 and only adds the first 7. If I put repeat untill a > 8 then it still asks for the 9th region although it does calculate the first 8 which is what I want it to do.
region_sales := 0.0;
total_sales := 0.0;
a := 0;
writeln ('Please enter sales for region ',a);
writeln ('The sales for all regions were ',total_sales:6:2);
a := a + 1;
total_sales := total_sales + region_sales;
until a = 8;
Thanks for any help :)
Oh yeah and I tried using the while statement (while total_sales > 9 do) but that keeps asking me for the 9th region before calculating the first 8 too.