I gang

Simple Javascript Coding


Brief: 3 loops added to Javascript code below

Instructions Are attached:

<script type="text/javascript">

/*[url removed, login to view]("Vadim Kushnir");

[url removed, login to view]("");

[url removed, login to view]("Janin V");

[url removed, login to view]("Javascript 2");*/

var customer = prompt("Welcome to Vadim's Ice Cream Shop! What is your name please?", "Your Name");

alert("Hello "+customer+ " please first look at our great variety of ice cream, then place your order.");

var flavor = prompt("What flavor of ice cream do you wish to have?", "enter your flavor request");

if(flavor== "vanilla")

price = 1*([url removed, login to view]);

if(flavor== "chocolate")

price = [url removed, login to view];

if(flavor== "lemon")

price = [url removed, login to view];

if(flavor== "mint")

price = [url removed, login to view];

if(flavor== "strawberry")

price = .99;

if(flavor== "blueberry")

price = [url removed, login to view];

var scoops= prompt("How many scoops of " +flavor+ " would you like to have?");


var ask= confirm(customer+" would you like to purchase "+scoops+" scoops of " +flavor+" ?");

if (ask== false)


alert(" Please reload the page when you are ready to order!");






var cone= 1* .75

var njtax= 1* .07

var totalcost= (Number(scoops)* Number(price)+ Number(cone));

if (flavor=="mint" && scoops==Number(3) )


totalcost=(Number(scoops)* Number(price)+ Number(cone)*.85);


if ( flavor=="chocolate" && scoops==Number(2) )


totalcost=(Number(scoops)* Number(price)+ Number(cone)*.88);


if (flavor=="chocolate" && scoops>=Number(4) )


(Number(scoops)* Number(price)+ Number(cone)*.83);


var total= (Number(totalcost)* Number(njtax)+ Number(totalcost));

[url removed, login to view](customer+', the cost of <i>'+scoops+'</i> scoops of <b>'+flavor+'</b> flavored ice cream is '+totalcost+ '<br> With tax, the total comes to <u>'+[url removed, login to view](2)+'</u><br>');

if (flavor=="chocolate" && scoops==Number(2) || flavor=="chocolate" && scoops>=Number(4) || flavor=="mint" && scoops==Number(3))

[url removed, login to view]("Thank you for purchasing one of our specials!")


[url removed, login to view]("")

</script>les tax.

Færdigheder: Javascript

Se mere: min cost, code coding, cream shop, v look, strawberry mint, simple javascript, price alert, flavored, flavor, cone, b v, page javascript simple, text alert, amp javascript, text javascript, page tax, ready javascript, price tax, javascript text, page javascript, javascript amp, coding amp, javascript write, simple write, amp coding

Om arbejdsgiveren:
( 0 bedømmelser ) Ocean, United States

Projekt-ID: #280059

Tildelt til:


Hi, Please see my PM. Thank you.

$30 USD in 0 dage
(5 bedømmelser)