Guest User

Untitled

a guest
Feb 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   var toppings = cpsc2030get( "toppings" );
  2.   var pizza_pep = cpsc2030get( "pizza_pep" );
  3.   var pizza_cheese = cpsc2030get( "pizza_cheese" );
  4.   var pizza_bacon = cpsc2030get( "pizza_bacon" );
  5.  
  6.     result += "Toppings: ";
  7.   if ( pizza_pep )
  8.   {
  9.     result += 'pep';
  10.     price += 1.00;
  11.   }
  12.   if ( pizza_cheese )
  13.   {
  14.     result += 'cheese';
  15.     price += 2.00;
  16.   }
  17.   if ( pizza_bacon )
  18.   {  
  19.     result += 'bacon';
  20.     price += 1.00;
  21.   }
  22.     result += "toppings: " + "<br />";
  23.  
  24.   var size = cpsc2030get( "size")
  25.   var small = cpsc2030get( "small" );
  26.   var medium = cpsc2030get( "medium" );
  27.   var large = cpsc2030get( "large" );
  28.  
  29.   if(size == 'small')
  30.     {
  31.         price = 10;
  32.     }
  33.  
  34.     if(size == 'medium')
  35.     {
  36.         price = 15;
  37.     }
  38.    
  39.     if(size == 'large')
  40.     {
  41.         price = 20;
  42.     }
  43.  
  44.     result += "size: ";
  45.    
  46. var total = size + toppings;
  47.  
  48.   cpsc2030set( "answer" + "You have ordered a " + size + " pizza. The toppings are : " + toppings " The final price for the pizza is : $" +total);
Add Comment
Please, Sign In to add comment