A website for a fictional pizza company. Created to demonstrate understanding of JavaScript constructors and prototypes.
- HTML
- CSS
- Bootstrap
- JavaScript
- jQuery
- GitHub repositories
- GitHub Pages
The website will allow users to choose the size of their pizza as well as one or more toppings and display the final cost of the pizza.
Describe: Pizza()
Test: It will return a Pizza object with properties for size and toppings.
Code: let newPizza = Pizza("m", ["olives", "mushrooms"], ["pepperoni"]);
Expected Output:
Pizza {
size: "m"
veg toppings: ["olives", "mushrooms"]
meat toppings: ["pepperoni"]
}
Describe: Pizza.prototype.addVegTopping
Test: It will add a new topping to the veggie toppings array.
Code:
newPizza.addVegTopping("mushrooms");
newPizza;
Expected Output:
Pizza {
size: "m"
veg toppings: ['mushrooms']
meat toppings: []
}
Describe: Pizza.prototype.addMeatTopping
Test: It will add a new topping to the meat toppings array.
Code:
newPizza.addMeatTopping("pepperoni");
newPizza;
Expected Output:
Pizza {
size: "m"
veg toppings: []
meat toppings: ['pepperoni']
}
Describe: Pizza.prototype.getPrice
Test: It will determine the price of the pizza, based on size.
Code:
let newPizza = new Pizza("m");
newPizza.getPrice();
Expected Output: 18
Test: It will determine the price of the pizza, based on size and toppings.
Code:
let newPizza = new Pizza("m", ['mushrooms'])
newPizza.getPrice();
Expected Output: 19
Test: It will determine the price of the pizza, based on size and toppings.
Code:
let newPizza = new Pizza("m", ['mushrooms'], ['pepperoni'])
newPizza.getPrice();
Expected Output: 21
View the project here: https://kpundt93.github.io/pizza-parlor/
- Navigate to https://github.com/kpundt93/pizza-parlor
- Click on the green "Code" button and copy the repository URL or click on the copy button
- Open the terminal on your desktop
- Once in the terminal, use it to navigate to your desktop folder
- Once inside your desktop folder, use the command
git clone https://github.com/kpundt93/pizza-parlor.git
- After cloning the project, navigate into it using the command
cd pizza-parlor
- Use the command
git remote
to confirm the creation of the new local repository - Open the project with the code editor of your choice
- No known bugs
Katie Pundt, [email protected]
MIT License: https://opensource.org/licenses/MIT
Copyright (c) 2021 Katie Pundt