Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ Describe how you approached to problem, and what tools and techniques you used t
## View it live

Have you deployed your project somewhere? Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about

https://github.com/Technigo/project-pizza/pull/150

https://liselottespizza2.netlify.app/
50 changes: 49 additions & 1 deletion code/script.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,67 @@
// Start here

let subChoice
// Step 1 - Welcome and introduction
// Your code goes here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove any code and comments that is not useful

alert(
`Welcome to our Javascript Pizzeria. Ready to Start? - Click 'OK' to begin.`
)

let person = prompt("Please enter your name:", "Harry Potter");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! Didn't know you could do this 🤓

// Step 2 - Food choice
// Your code goes here
alert(`Hello ${person}! What would you like to order?`)
// later fix invalied, for example other numbers.
let foodChoice = prompt(`Select the number of the food you would like to eat. 1.Pizza 2.Pasta 3.Salad`, "");

// Step 3 - Subtype choice
// Your code goes here
if (foodChoice === "1") { foodChoice = "Pizza"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

if (foodChoice === "1") {
  foodChoice = "Pizza"

alert("You have chosen Pizza!")
subChoice = prompt(`What kind of Pizza would you like to eat? 1.Margherita 2.Pepperoni 3.Hawaiian`, "")
if (subChoice === "1") { subChoice = "Margherita"
alert("You have chosen Margherita!")
} else if (subChoice === "2") { subChoice = "Pepperoni"
alert("You have chosen Pepperoni!")
} else { subChoice = "Hawaiian"
alert("You have chosen Hawaiian!")
}
} else if (foodChoice === "2") { foodChoice = "Pasta"
alert("You have chosen Pasta!")
subChoice = prompt(`What kind of pasta would you like to eat? 1.Spaghetti Bolognaise 2.Lasagne 3.Fettuccine Alfredo`, "")
if (subChoice === "1") { subChoice = "Spaghetti Bolognaise"
alert("You have chosen Spaghetti Bolognaise!")
} else if (subChoice === "2") { subChoice = "Lasagne"
alert("You have chosen Lasagne!")
} else { subChoice = "Fettuccine Alfredo"
alert("You have chosen Fettuccine Alfredo!")
}
} else { foodChoice = "Salad"
alert("you have chosen Salad!")
subChoice = prompt(`What kind of Sallad would you like to eat? 1.Caesar salad 2.Greek salad 3.Pasta salad`, "")
if (subChoice === "1") { subChoice = "Caesar salad"
alert("You have chosen Caesar salad!")
} else if (subChoice === "2") { subChoice = "Greek salad"
alert("You have chosen Greek salad!")
} else { subChoice = "Pasta salad"
alert("You have chosen Pasta salad!")
}
};

// Step 4 - Age
// Your code goes here
let age = prompt(`Is the food for an adult or for a child? Please enter your age`, "");
if ( parseInt(age) <= 15 ) {
alert("The food is for a child")
} else {
alert("The food is for an adult")
};

// Step 5 - Order confirmation
// Your code goes here
let confirmation = confirm(`Please confirm that your name is ${person}, that the food you ordered is ${foodChoice} and ${subChoice} and that
you are ${age} years old `)
if ( confirmation === true ) {
alert("Thank you for your order! Your food will arrive soon.")
} else {
alert("Sorry, please return in the future.")
};