troubleshooting Question

Javascript Question help

Avatar of antmoore123
antmoore123 asked on
Programming Languages-Other
2 Comments1 Solution434 ViewsLast Modified:
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>
ebook-m150-tma2-08J--e10i1-web00.pdf
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros