SlideShare a Scribd company logo
Project Overview
• Project Title: Coffee Ordering System in Java
• Developed By: Kanak Kumar
• This Java console-based program allows users
to order different types of coffee with optional
additions like whipped cream and flavors,
calculates the bill including tax, and accepts
user rating at the end.
Class and Method Introduction
• public class CoffeeOrderingSystem2 {
• - Defines the main class of the program.
• - Class contains methods for cream addition,
flavor selection, and main order logic.
Method - cream()
• int cream() {
• Scanner scanner = new Scanner(System.in);
• ...
• return c == 1 ? 30 : 0;
• }
• - Takes user input: Do they want whipped
cream?
• - If yes (1), adds ₹30 to the bill.
Method - flavor()
• int flavor() {
• Scanner scanner = new Scanner(System.in);
• ...
• return switch(c) {
• case 1 -> yield 20;
• ...
• default -> yield 0;
• };
main() Method Begins
• public static void main(String[] args) {
• CoffeeOrderingSystem2 t = new
CoffeeOrderingSystem2();
• Scanner scanner = new Scanner(System.in);
• - Creates object t to access non-static
methods.
• - Scanner initialized for input.
• - Displays welcome message.
Coffee Selection Menu
• do {
• System.out.println("choose your coffee...");
• choice = scanner.nextInt();
• } while(choice > 11 || choice < 0);
• - Menu-driven coffee selection using a do-
while loop.
• - Validates user input between 1 to 11.
Coffee Choice Handling (Switch)
• switch(choice) {
• case 1 -> {
• System.out.println("LATTE");
• bill += 200;
• bill += t.cream();
• bill += t.flavor();
• }
• ...
• }
Tax Calculation and Final Bill
• double taxbill = 0;
• if(bill > 0) {
• taxbill = bill + (0.18 * bill);
• System.out.println("Total bill = " + taxbill);
• }
• - If a valid coffee was selected, adds 18% GST
to the bill.
User Rating & Feedback
• System.out.println("Rate us 0 to 5");
• int r = scanner.nextInt();
• for(int i = 1; i <= r; i++) {
• System.out.println("* ");
• }
• - Takes rating input.
• - Displays stars (*) according to user feedback.
Final Summary
• ✅ Object-Oriented Design
• ✅ Scanner for User Input
• ✅ switch-case & if-else usage
• ✅ Looping (do-while, for)
• ✅ GST Calculation
• ✅ Real-world simulation in console
• Developed by: Kanak Kumar

More Related Content

PPTX
Electricity billing system contain java console application
PPTX
Food order
PPTX
E-Restaurant Management System
PPTX
Business Information System on Zomato base
PPTX
foodorder-170421171524 (1).pptx
PPTX
Laptop Selection System
PPTX
Online Pizza Ordering System using Java.pptx
PPTX
Automated Coffee machine
Electricity billing system contain java console application
Food order
E-Restaurant Management System
Business Information System on Zomato base
foodorder-170421171524 (1).pptx
Laptop Selection System
Online Pizza Ordering System using Java.pptx
Automated Coffee machine

Similar to Coffee ordering system using java cosole (20)

PPTX
Ppt Report Online Coffee Shop using MAD.pptx
PPTX
Customer ordering system
PPTX
IT Service Intelligence Hands On Breakout Session
PPT
C++ super market
PPTX
Restaurant manager app
PPTX
PPTX
IT Service Intelligence Hands On Breakout Session
PPTX
CSMS PRESENTATION.pptx this presentation includes a coff...
PDF
ONLINE FOOD ORDERING WEBSITE PPT WHICH IS FOR
PDF
Food ordering system for red bangladesh course system ananlysis
PPTX
STARBUCKS SelfHelp System - Kiosk System
PPTX
Test Cases - are they dead?
PPTX
IT Service Intelligence Hands On
PPTX
Online Shopping PPT LOGO[1].pptx
PPTX
IT Service Intelligence Hands On Breakout Session
PPTX
online restaurant billing system ppt vsics
PDF
Canteen Food Management System
PPTX
Presentation acme sys999tems Ragini 1.pptx
PPTX
Chromatography Data system: Process your Data
PPTX
Online Food Ordering Web- Application using python
Ppt Report Online Coffee Shop using MAD.pptx
Customer ordering system
IT Service Intelligence Hands On Breakout Session
C++ super market
Restaurant manager app
IT Service Intelligence Hands On Breakout Session
CSMS PRESENTATION.pptx this presentation includes a coff...
ONLINE FOOD ORDERING WEBSITE PPT WHICH IS FOR
Food ordering system for red bangladesh course system ananlysis
STARBUCKS SelfHelp System - Kiosk System
Test Cases - are they dead?
IT Service Intelligence Hands On
Online Shopping PPT LOGO[1].pptx
IT Service Intelligence Hands On Breakout Session
online restaurant billing system ppt vsics
Canteen Food Management System
Presentation acme sys999tems Ragini 1.pptx
Chromatography Data system: Process your Data
Online Food Ordering Web- Application using python
Ad

Recently uploaded (20)

PPTX
Construction Project Organization Group 2.pptx
PDF
PPT on Performance Review to get promotions
PPT
Project quality management in manufacturing
PPTX
Sustainable Sites - Green Building Construction
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Artificial Intelligence
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
DOCX
573137875-Attendance-Management-System-original
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPT
Mechanical Engineering MATERIALS Selection
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Geodesy 1.pptx...............................................
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Construction Project Organization Group 2.pptx
PPT on Performance Review to get promotions
Project quality management in manufacturing
Sustainable Sites - Green Building Construction
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Embodied AI: Ushering in the Next Era of Intelligent Systems
Artificial Intelligence
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
CYBER-CRIMES AND SECURITY A guide to understanding
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
573137875-Attendance-Management-System-original
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Mechanical Engineering MATERIALS Selection
Automation-in-Manufacturing-Chapter-Introduction.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Geodesy 1.pptx...............................................
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Ad

Coffee ordering system using java cosole

  • 1. Project Overview • Project Title: Coffee Ordering System in Java • Developed By: Kanak Kumar • This Java console-based program allows users to order different types of coffee with optional additions like whipped cream and flavors, calculates the bill including tax, and accepts user rating at the end.
  • 2. Class and Method Introduction • public class CoffeeOrderingSystem2 { • - Defines the main class of the program. • - Class contains methods for cream addition, flavor selection, and main order logic.
  • 3. Method - cream() • int cream() { • Scanner scanner = new Scanner(System.in); • ... • return c == 1 ? 30 : 0; • } • - Takes user input: Do they want whipped cream? • - If yes (1), adds ₹30 to the bill.
  • 4. Method - flavor() • int flavor() { • Scanner scanner = new Scanner(System.in); • ... • return switch(c) { • case 1 -> yield 20; • ... • default -> yield 0; • };
  • 5. main() Method Begins • public static void main(String[] args) { • CoffeeOrderingSystem2 t = new CoffeeOrderingSystem2(); • Scanner scanner = new Scanner(System.in); • - Creates object t to access non-static methods. • - Scanner initialized for input. • - Displays welcome message.
  • 6. Coffee Selection Menu • do { • System.out.println("choose your coffee..."); • choice = scanner.nextInt(); • } while(choice > 11 || choice < 0); • - Menu-driven coffee selection using a do- while loop. • - Validates user input between 1 to 11.
  • 7. Coffee Choice Handling (Switch) • switch(choice) { • case 1 -> { • System.out.println("LATTE"); • bill += 200; • bill += t.cream(); • bill += t.flavor(); • } • ... • }
  • 8. Tax Calculation and Final Bill • double taxbill = 0; • if(bill > 0) { • taxbill = bill + (0.18 * bill); • System.out.println("Total bill = " + taxbill); • } • - If a valid coffee was selected, adds 18% GST to the bill.
  • 9. User Rating & Feedback • System.out.println("Rate us 0 to 5"); • int r = scanner.nextInt(); • for(int i = 1; i <= r; i++) { • System.out.println("* "); • } • - Takes rating input. • - Displays stars (*) according to user feedback.
  • 10. Final Summary • ✅ Object-Oriented Design • ✅ Scanner for User Input • ✅ switch-case & if-else usage • ✅ Looping (do-while, for) • ✅ GST Calculation • ✅ Real-world simulation in console • Developed by: Kanak Kumar