PascalRookie 0 Newbie Poster

Hello, I have this code, but it does not work, i everytime i fix one error i get more, i have attached the assignment, and then my work, thanks for any help or pointers in the right direction
Write a program to calculate and print out water bills.

The rates vary depending on whether the customer is a home user (code H), a commercial user (Code C) or an industrial user (Code I). No other code should be accepted. The rates are as follows:

Code H: A flat $5.00 fee plus $0.0005 per gallon used.
Code C: $1000 for the first 4 million gallons used plus $0.00025 for each additional gallon.
Code I: $1000 for up to and including 4 million gallons; $2000 for more than 4 million gallons up to and including 10 million gallons; and $3000 for more than 10 million gallons.

Inputs from the user are a four-digit account number (you don't need to error check this), the user code, and the number of gallons used. The valid user codes should be required and the number of gallons used should be equal to or greater than 0.

The output should display all the input as well as the amount of the bill neatly with descriptive text.

At minimum, the program should use separate subprograms for getting input, calculating the amount of the bill, and producing output. 

NOTE: In order to use pass by value, the subprogram that gets the input should call the subprogram that calculates the bill, and the subprogram that calculates the bill should call the subprogram that produces output.

********************* here is my work************************

PROGRAM week_6_Program_3 (input, output);


Uses
    sysutils;
       var
         acc_num,code,num_gallons : integer;


        PROCEDURE Input; { get needed input to run the procedure}
          begin
            writeln ('Please enter in customers 4 digit account number:');
              readln (acc_num);
            writeln ('Please enter user code:(C,H,I)');
              readln (Code);
            writeln ('How many gallons of water were used:');
              readln (num_gallons)
                while num_gallons < 0 do
                 writeln ('Gallons used must be greater then or equal to 0 gallons used!');
                   writeln ('How many gallons of water were used:');
                     readln (num_gallons);
          end;

        PROCEDURE CalculateBill;
          BEGIN
           case code of
             'H' = 5.00 + (0.0005 * num_gallons);

             'C' = 1000
              If (num_gallons > 4000000) then
               C = 1000 + (0.00025 * num_gallons);

             'I' = 1000
              IF  (num_gallons > 4000001) and (num_gallons < 10000000) then
                I = 2000
              else
                IF
                   (num_gallons > 10000001) then
                    I = 3000

            END;

          PROCEDURE output
            BEGIN
              writeln (' Your four digit account number is: ',acc_num:4:0);
               writeln ('Your user code is: ',code);
                 writeln (' Your total water usage is: ',num_gallons,);
                   writeln ('Your total bill is:', total_bill);

begin
      input;
      calculatebill;
      output;

      writeln ('Press <enter> to exit!');
        readln;

end.

thanks again for any pointers :c