-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pizza Project pull #151
Open
smily342
wants to merge
3
commits into
Technigo:main
Choose a base branch
from
smily342:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Pizza Project pull #151
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Javascript Pizzeria</title> | ||
<link rel="stylesheet" href="./style.css" /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" | ||
rel="stylesheet" | ||
/> | ||
</head> | ||
<body> | ||
<h1>Javascript Pizzeria</h1> | ||
<p>Logic is executed automatically</p> | ||
<script src="./script.js"></script> | ||
</body> | ||
</html> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Javascript Pizzeria</title> | ||
<link rel="stylesheet" href="./style.css" /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" | ||
rel="stylesheet" /> | ||
</head> | ||
|
||
<body> | ||
<h1>Javascript Pizzeria</h1> | ||
<p>Logic is executed automatically</p> | ||
<script src="./script.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,89 @@ | ||
// Start here | ||
|
||
// Step 1 - Welcome and introduction | ||
// Your code goes here | ||
alert( | ||
`Welcome to our Javascript Pizzeria. Ready to Start? - Click 'OK' to begin.` | ||
) | ||
|
||
//Loop until a name is given | ||
let userName = ""; | ||
while (!userName) { | ||
userName = prompt("What's your name? Please enter your name:"); | ||
} | ||
|
||
// Afficher un message de bienvenue une fois que le nom est entré | ||
alert("Hello, " + userName + " !"); | ||
// Step 2 - Food choice | ||
// Your code goes here | ||
let foodChoice = prompt("What would you like to order ? Select a number :\n1. Pizza\n2. Pasta\n3. Salad"); | ||
|
||
if (foodChoice == 1) { | ||
alert("You've chosen a Pizza."); | ||
} else if (foodChoice == 2) { | ||
alert("You've chosen some Pasta."); | ||
} else if (foodChoice == 3) { | ||
alert("You've chosen a Salad."); | ||
} else { | ||
alert("Invalid Choice."); | ||
} | ||
|
||
// Step 3 - Subtype choice | ||
// Your code goes here | ||
// Subtype for Pizza | ||
if (foodChoice == 1) { | ||
let pizzaType = prompt("Which pizza would you like ?\n1. Margherita\n2. Pepperoni\n3. 4 cheeses"); | ||
if (pizzaType == 1) { | ||
alert("You've chosen a Margherita Pizza."); | ||
} else if (pizzaType == 2) { | ||
alert("You've chosen a Pepperoni Pizza."); | ||
} else if (pizzaType == 3) { | ||
alert("You've chosen a 4 Cheeses Pizza."); | ||
} else { | ||
alert("Invalid Choice."); | ||
} | ||
} | ||
|
||
// Subtype for Pasta | ||
if (foodChoice == 2) { | ||
let pastaType = prompt("Which type of pasta would you like?\n1. Carbonara\n2. Bolognese\n3. Pesto"); | ||
if (pastaType == 1) { | ||
alert("You've chosen Carbonara Pasta."); | ||
} else if (pastaType == 2) { | ||
alert("You've chosen Bolognese Pasta."); | ||
} else if (pastaType == 3) { | ||
alert("You've chosen Pesto Pasta."); | ||
} else { | ||
alert("Invalid Choice."); | ||
} | ||
} | ||
|
||
// Subtype for Salad | ||
if (foodChoice == 3) { | ||
let saladType = prompt("Which type of salad would you like?\n1. Caesar\n2. Greek\n3. Niçoise"); | ||
if (saladType == 1) { | ||
alert("You've chosen a Caesar Salad."); | ||
} else if (saladType == 2) { | ||
alert("You've chosen a Greek Salad."); | ||
} else if (saladType == 3) { | ||
alert("You've chosen a Niçoise Salad."); | ||
} else { | ||
alert("Invalid Choice."); | ||
} | ||
} | ||
|
||
// Step 4 - Age | ||
// Your code goes here | ||
// Asking if the order is for an Adult or A child, the user must enter his age | ||
let ageGroup = prompt("Is the meal for a child or an adult? What's your age ?"); | ||
|
||
// Déclaration des prix | ||
let finalPrice; | ||
if (ageGroup >= 18) { | ||
// Adult | ||
finalPrice = 10; // Prix pour un adulte | ||
alert("You've selected a meal for an adult. The price is " + finalPrice + " CHF."); | ||
} else { | ||
// Minor | ||
finalPrice = 7; // Prix pour un enfant | ||
alert("You've selected a meal for a child. The price is " + finalPrice + " CHF."); | ||
} | ||
|
||
// Step 5 - Order confirmation | ||
// Your code goes here | ||
let confirmation = prompt("Would you like to confirm your order? Type 'yes' or 'no'."); | ||
if (confirmation.toLowerCase() == 'yes') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excellent! |
||
alert("Thank you! Your meal will be prepared shortly. The total cost is " + finalPrice + " CHF."); | ||
} else { | ||
alert("We hope to see you again soon!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Practicing terminal commands? 😄 Remove any files you're not using before handing in