{"size": 761, "ext": "js", "max_stars_repo_path": "js/scripts.js", "max_stars_repo_name": "alexanserg/week4project", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/scripts.js", "max_issues_repo_name": "alexanserg/week4project", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/scripts.js", "max_forks_repo_name": "alexanserg/week4project", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.3823529412, "max_line_length": 82, "alphanum_fraction": 0.5768725361}
function Pizza (topping, size) {
  this.topping = [],
  this.size =  parseFloat($("input:radio[name=size]:checked").val());
}


Pizza.prototype.cost = function () {
  return  (this.topping.length * .5) + (this.size * 5);
}






$(document).ready(function() {
  $("#pizza").submit(function(event) {
    event.preventDefault();
    var pizza = new Pizza();
    toppings = pizza.topping;

    $("input:checkbox[name=toppings]:checked").each(function(){
      toppings.push($(this).val());
    });
    var output = pizza.cost().toFixed(2);
    console.log(pizza.size);
    if (output >= 5) {
      $("#price").text("Your pizza with " + toppings + " will be" + "$" + output);
    }  else {
      $("#price").text("Please select toppings and Size");
    }
  });
});
