Link to home
Start Free TrialLog in
Avatar of antmoore123
antmoore123

asked on

Javascript Question help

New here so hi to all
I've just started a degree and the question i'm on at the moment is about writing code for a pizza delivery company i have attached the question its part(iii) of question 4 on page 14

I have started wiriting the code but got stuck i'm not sure if i can use another 'if' after the else'

Any help would be much appriciated

Thanks,  Anthony
<HTML>
<HEAD>
<TITLE>TMA 02 Q4(iii)</TITLE>
 
<SCRIPT LANGUAGE = "JavaScript">
 
// A delivery charge program for the Fenland Pizza Company
 
var distance;
var extraDistance; // A variable you will need to use
 
distance = window.prompt('Please enter the distance in miles', '');
distance = parseFloat(distance);
 
if (distance <= 3)
{
	document.write('Your delivery will be free');
}
else
{
extraDistance = window.prompt('Please enter the extra distance in miles', '');
extraDistance = parseFloat(extraDistance);
 
 
 
</SCRIPT>
 
</HEAD>
<BODY>
 
</BODY>
</HTML>

Open in new window

ebook-m150-tma2-08J--e10i1-web00.pdf
ASKER CERTIFIED SOLUTION
Avatar of Panchux
Panchux
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of antmoore123
antmoore123

ASKER

This works great thanks