Skip to content

gittebe/project-pizza

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript Pizzeria & Café Order System

This project is a hands-on exercise to practice handling user input, control structures, and basic order management in JavaScript. It implements a dynamic ordering system for a pizzeria and café using JavaScript. It allows users to choose from a range of food and drink options, while incorporating basic control flow techniques such as if, else, and switch statements.

Key Features

User Input: Collects the user’s name, food and drink preferences, and age to customize the order.

Control Flow: Utilizes both if/else if and switch methods to handle different types of orders for food and drinks.

Age-based Size: Suggests meal sizes based on the user’s age (e.g., regular or kids' sizes).

Flexible Options: Users can select from multiple food options (Pizza, Pasta, Salad) and drinks (Coffee, Lemonade, Juice).

How it works:

Start: The program begins by greeting the user and prompting them for their name.

Food Ordering: The user chooses from a list of food items (Pizza, Pasta, Salad). Depending on their choice, they are asked to select the specific type of food.

Age Input: Based on the user’s age, the program determines the appropriate size for their order (e.g., small for kids).

Drink Ordering: Users can also choose a drink from Coffee, Lemonade, or Juice, with additional selection options.

Confirmation: After selecting both food and drink, the user receives a confirmation of their order with size based on age.

Technical Details

Control Flow: The project showcases both if/else and switch control flow methods to handle multiple user inputs.

Comments & Flexibility: By commenting and uncommenting specific sections of code (such as the if/else or switch statements), the program can run in different configurations, showcasing flexibility between two methods of handling logic.

Files

index.html: The main HTML file containing the structure of the web page.

style.css: The CSS file for basic styling.

script.js: JavaScript code using if/else for order flow.

switch.js: JavaScript code using switch statements for order flow.

View it live

https://pizza-pasta-salad.netlify.app/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.1%
  • HTML 11.0%
  • CSS 4.9%