Need help in building functions in javascript : A parking garage charges a $2.00 minimum fee to park for up to three hours. It charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. 

The web page should calculate the entry hour and minute as well as the exit hour and minute with text boxes. Hours will be entered in a 24 hour format. Once the submit button is selected, the webpage should display the charge, total number of charges and running total of charges. Note that the latter two values will be maintained as the page is used repetedly.

Create and use functions calculateTime and calculateCharge, the former to figure the amount of time in the garage and the latter to figure the charge. 

I got the HTML running, however I cannot get the values to display on to the textbox. I also cannot figure out how to calculate the charge. Any help would be appreciated! Thank you.

HTML CODE:

    <!DOCTYPE html>
    <html>
    <head>
    <title>Parking Charge</title>
    </head>
    <body><div align="center">
    <form id="1"><h1><p style="background-color:black ; color:gold;">Parking Garage Charge Calculator</p></h1><hr>
    <p>ENTRY TIME: <input type = "number" name = "EntryTime" id = "entTime"></p>
    <p>EXIT TIME :  <input type="number" id="extTime" name="ExitTime">
    <p>Number of Hours Parked: <input type ="number" name="noOfHours" id="nh"><br><br>
    <input type="button" id="calculate" name="calc" value="Calculate" onclick="calculateTime()"/>
    <input type="reset" id="resetBtn" value="Clear"><br><br>
    <input type="number" id="total" name="totalCost" placeholder="Your Total Payment" readonly/><hr>
    </form>
    </div>
    </body>
    <script src="P2JS.js"></script>
    </html>

JAVASCRIPT CODE:

    function calculateTime(){
    
    var EntryTime = document.getElementById('entTime').value;
    var ExitTime = document.getElementById('extTime').value;
    
    var noOfHours = (EntryTime - ExitTime);
    document.getElementById("nh").innerHTML = noOfHours;
    }
    
    /*Function to calculate the payment on the number of hours parked*/
    
    function calculateCharge(){
    var charge = 3.50;
    var payment = (noOfHours * charge);
    if (noOfHours <= 3){
    	totalPayment = charge * noOfHours;
    	return payment;
    }
    else {
    	payment = ((noOfHours - 3) * (charge + 0.50)) + (charge * 3);
    	return payment;
    }
    }