You are on page 1of 8

COMPUTER

PROJECT
Topic: Donut shop management

Acknowledgements
I would like to express my special thanks of gratitude to my teacher Eknath Bhoir
as well as our principal Kalyani Choudhary who gave me the golden opportunity to
do this wonderful project on the topic "Donut Shop Management”.

Secondly, I would also like to thank my parents and friends who helped me a lot in
finalizing this project within the limited time frame as well as helping me out with
the coding part of the project.

DONUT SHOP MANAGEMENT


Code:

import java.util.*;
class e_donut{
Scanner in=new Scanner(System.in);
int number,donu,nos,d_num,ans,price=0;
Long phnumber;
double tax,amount;
String donuts_name[]=new String[]{"1.Belgium Chocolate 100Rs","2.Plain
Sugar 100Rs","3.Irish Coffee 100Rs","4.Chocolate Iced 100Rs","5.Glazed
Blueberry 150Rs","6.Jelly Filled 150Rs","7.Sour Cream 150Rs","8.Boston Kreme
150Rs","9.Powdered PLain 150Rs","10.Strawberry Iced 150Rs"};
String name,dname,strngans;
String dchosen[]=new String[1000];
int donuts[]=new int[1000];
void customer(){
System.out.println("Welcome to The Donut Shop");
System.out.println("Please enter you name");
name=in.nextLine();
System.out.println("Hi "+name+", please enter your Phone Number");
phnumber=in.nextLong();
}
void display_menu(){
System.out.println("Donuts available today: ");
for(int i=0;i<10;i++){
System.out.println(donuts_name[i]);
}
}

void donutschoice(){
System.out.println("Will you be ordering more than 1 donut? \nEnter 1 for yes
or 2 for no");
ans=in.nextInt();

if(ans==2){
System.out.println("Please type in the corresponding number for the donut
you want");
number=in.nextInt();

if(ans==1){
System.out.println("How Much Donuts will you be ordering, "+name);
nos=in.nextInt();
System.out.println("Please enter the corresponding numbers for the
donuts you want");
for(int i=0;i<nos;i++){
donuts[i]=in.nextInt();
}

else{
System.out.println("Error");
}

}
void calc(){
if(ans==2){
if(d_num<5){
price=price+100;
}
else{
price=price+150;
}

}
if(ans==1){
for(int i=0;i<nos;i++){
d_num=donuts[i];
dchosen[i]=donuts_name[d_num-1];
if(d_num<5){
price=price+100;
}
else{
price=price+150;
}
}
}
}
void bill(){
if(ans==1){
for(int i=0;i<nos;i++){
d_num=donuts[i];
dchosen[i]=donuts_name[d_num-1];
System.out.println(dchosen[i]);

}
tax=(18.0/100.0)*price;
System.out.println("------------------- -------------------");
System.out.println("Total before tax: "+price+"Rs");
System.out.println("Tax(18%): "+tax);
amount=price+tax;
System.out.println("Grand Total: "+amount+"Rs");
System.out.println("Thank you "+name+", for shopping at The Donut Store with
Phone no.: "+phnumber);

///////
if(ans==2){
dname=donuts_name[(number)-1];
System.out.println(dname);
tax=(18.0/100.0)*price;
System.out.println("------------------- -------------------");
System.out.println("Total before tax: "+price+"Rs");
System.out.println("Tax(18%): "+tax);
amount=price+tax;
System.out.println("Grand Total: "+amount+"Rs");
System.out.println("Thank you "+name+", for shopping at The Donut Store with
Phone no.: "+phnumber);
}
}
static void main(){

e_donut obj=new e_donut();


obj.customer();
obj.display_menu();
obj.donutschoice();
obj.calc();
obj.bill();

}
}
Input + Output:
Welcome to The Donut Shop
Please enter you name
Jhon
Hi Jhon, please enter your Phone Number
123456789
Donuts available today:
1.Belgium Chocolate 100Rs
2.Plain Sugar 100Rs
3.Irish Coffee 100Rs
4.Chocolate Iced 100Rs
5.Glazed Blueberry 150Rs
6.Jelly Filled 150Rs
7.Sour Cream 150Rs
8.Boston Kreme 150Rs
9.Powdered PLain 150Rs
10.Strawberry Iced 150Rs
Will you be ordering more than 1 donut?
Enter 1 for yes or 2 for no
1
How Much Donuts will you be ordering, Jhon
4
Please enter the corresponding numbers for the donuts you want
1
2
3
3
1.Belgium Chocolate 100Rs
2.Plain Sugar 100Rs
3.Irish Coffee 100Rs
3.Irish Coffee 100Rs
------------------- -------------------
Total before tax: 400Rs
Tax(18%): 72.0
Grand Total: 472.0Rs
Thank you Jhon, for shopping at The Donut Store with Phone no.: 123456789

---------------------------Thank You-------------------------

You might also like