Java Project Class 10th ICSE
Java Project Class 10th ICSE
1. Algorithm
…………………………………………….. 2
2. Flow Chart
……………………………………………. 3-4
3. Source Code
…………………………………………... 5-49
4. Output
……………………………………. 50- 52
5. Data Description Table
………………………………... 53-54
1
Algorithm
Step 1: Start
Step 2: Declaring variables
String choice="Y";
int m_ch, sc_ch1, ch1, qnt, amt=0, ch2, qnt2, ch3, qnt3, ch4, qnt4, ch5,
qnt5,totamt=0,sc_ch2, sc_ch3, sc_ch4, sc_ch5, sc_ch6,sc_ch7, sc_ch8,
sc_ch9, sc_ch10;
double gst,tgst;
Step 3: Select a main category
Step 4: Select a sub-category from the main category chosen
Step 5: Select the item
Step 6: Select the quantity
Step 7: Enter ‘Y’ to add more to basket or ‘N’ to exit and print bill
Step 8: Bill is printed with gst
Step 9: Stop
2
Flowchart
3
4
Source Code
import java.util.*;
class demo
{
public static void main (String args[])
{
Scanner in=new Scanner (System.in);
String choice="Y";
int m_ch,sc_ch1,ch1,qnt,amt=0,ch2,qnt2,ch3,qnt3,ch4,qnt4,ch5,qnt5,totamt=0;
int sc_ch2, sc_ch3, sc_ch4, sc_ch5, sc_ch6,sc_ch7, sc_ch8, sc_ch9, sc_ch10;
double gst,tgst;
System.out.println("===== Welcome to our Grocery App =====");
while (choice.equalsIgnoreCase("Y"))
{
System.out.println("Please select a main category: ");
System.out.println("1. Fruits");
System.out.println("2. Vegetables");
System.out.println("3. Dairy products");
System.out.println("4. Meat and poultry");
System.out.println("5. Bakery");
System.out.println("6. Beverages");
System.out.println("7. Snacks");
System.out.println("8. Canned and packaged foods");
System.out.println("9. Personal care");
System.out.println("10. Household essentials");
m_ch=in.nextInt();
switch(m_ch)
{
case 1:
System.out.println("===== Fruits =====");
5
System.out.println("1. Citrus fruits");
System.out.println("2. Berries");
System.out.println("3. Tropical fruits");
System.out.println("4. Melons");
System.out.println("5. Stone fruits");
System.out.println("Please select a subcategory: ");
sc_ch1=in.nextInt();
switch (sc_ch1)
{
case 1:
System.out.println("1. Oranges: Rs. 80/kg");
System.out.println("2. Lemons: Rs. 80/kg");
System.out.println("3. Grapefruits: Rs. 90/kg");
System.out.println("4. Lime: Rs. 90/kg");
System.out.println("5. Mandarian: Rs. 100/kg");
System.out.println("6. Tangerine: Rs. 90/kg");
System.out.println("7. Pomelo: Rs. 80/kg");
System.out.println("8. Yuzu: Rs. 120/kg");
System.out.println("9. Bergamot: Rs. 120/kg");
System.out.println("10. Citron: Rs. 100/kg");
System.out.println("Enter your choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
if(ch1==1||ch1==2||ch1==7)
amt= qnt*80;
if(ch1==3||ch1==4||ch1==6)
amt=qnt*90;
if(ch1==5||ch1==10)
amt=qnt*100;
if(ch1==8||ch1==9)
amt=qnt*12;
6
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
System.out.println("1. Strawberries: Rs. 180/kg");
System.out.println("2. Raspberries: Rs. 250/kg");
System.out.println("3. Blackberries: Rs. 180/kg");
System.out.println("4. Cranberries: Rs. 250/kg");
System.out.println("5. Gooseberries: Rs. 180/kg");
System.out.println("6. Huckleberries: Rs. 250/kg");
System.out.println("7. Elderberries: Rs. 350/kg");
System.out.println("8. Boysenberries: Rs. 250/kg");
System.out.println("9. Mulberries: Rs. 180/kg");
System.out.println("10. Cherries: Rs. 350/kg");
System.out.println("Enter your choice");
ch2=in.nextInt();
System.out.println("Enter quantity");
qnt2=in.nextInt();
if(ch2==1||ch2==3||ch2==5||ch2==9)
amt=qnt2*180;
if(ch2==2||ch2==4||ch2==6||ch2==8)
amt=qnt2*250;
if(ch2==7||ch2==10)
amt=qnt2*350;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 3:
System.out.println("1. Mangoes: Rs. 100/kg");
System.out.println("2. Pineapples: Rs. 50 each");
7
System.out.println("3. Papayas: Rs. 50/kg");
System.out.println("4. Dragon Fruits: Rs. 150/kg");
System.out.println("5. Passion Fruits: Rs. 200/kg");
System.out.println("6. Kiwis: Rs. 100/dozen");
System.out.println("7. Guavas: Rs. 50/kg");
System.out.println("8. Pineapple Apples: Rs. 100/kg");
System.out.println("9. Starfruits: Rs. 100/kg");
System.out.println("10. Jackfruits: Rs. 50/kg");
System.out.println("Enter your choice");
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==2||ch3==3||ch3==7||ch3==10)
amt= qnt3*50;
if(ch3==4)
amt= qnt3*150;
if(ch3==1||ch3==6||ch3==8||ch3==9)
amt= qnt3*100;
if(ch3==5)
amt= qnt3*200;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
System.out.println("1. Watermelons: Rs. 40/kg");
System.out.println("2. Cantaloupes: Rs. 40/kg");
System.out.println("3. Honeydews: Rs. 40/kg");
System.out.println("4. Galia Melons: Rs. 60/kg");
System.out.println("5. Canary Melons: Rs. 60/kg");
System.out.println("6. Charentais Melons: Rs. 60/kg");
System.out.println("7. Casaba Melons: Rs. 100/kg");
8
System.out.println("8. Persian Melons: Rs. 100/kg");
System.out.println("9. Piel de Sapo Melons: Rs. 100/kg");
System.out.println("Enter you choice");
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==2||ch4==3)
amt= qnt4*40;
if(ch4==4||ch4==5||ch4==6)
amt= qnt4*60;
if(ch4==7||ch4==8||ch4==9)
amt= qnt4*100;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1. Price of Peaches: Rs. 100/kg");
System.out.println("2. Price of Nectarines: Rs. 100/kg");
System.out.println("3. Price of Plums: Rs. 80/kg");
System.out.println("4. Price of Apricots: Rs. 150/kg");
System.out.println("5. Price of Cherries: Rs. 150/kg ");
System.out.println("6. Price of Pears: Rs. 80/kg");
System.out.println("7. Price of Persimmons: Rs. 80/kg");
System.out.println("8. Price of Mangoes: Rs. 120/kg");
System.out.println("9. Price of Dates: Rs. 120/kg ");
System.out.println("10.Price of Lychees: Rs. 100/kg ");
System.out.println("Enter you choice");
ch5=in.nextInt();
System.out.println("Enter quantity");
qnt5=in.nextInt();
if(ch5==1||ch5==2||ch5==10)
9
amt= qnt5*100;
if(ch5==3||ch5==6||ch5==7)
amt= qnt5*80;
if(ch5==4||ch5==5)
amt= qnt5*150;
if(ch5==8||ch5==9)
amt= qnt5*120;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
default:
System.out.println("Wrong Choice !!!");
}
break;
case 2:
System.out.println("===== Vegetables =====");
System.out.println("1. Leafy greens");
System.out.println("2. Root vegetables");
System.out.println("3. Cruciferous vegetables");
System.out.println("4. Squash");
System.out.println("5. Alliums");
System.out.println("Please select a subcategory: ");
sc_ch2=in.nextInt();
switch (sc_ch2)
{
case 1:
System.out.println("1. Price of Spinach: Rs. 40/kg");
System.out.println("2. Price of Arugula: Rs. 30/kg");
System.out.println("3. Price of Swiss Chard: Rs. 40/kg");
System.out.println("4. Price of Collard Greens: Rs. 60/kg");
System.out.println("5. Price of Bok Choy: Rs.30/kg");
10
System.out.println("6. Price of Watercress: Rs. 60/kg");
System.out.println("7. Price of Mustard Greens: Rs. 40/kg");
System.out.println("8. Price of Endive: Rs. 30/kg");
System.out.println("9. Price of Kale: Rs. 60/kg");
System.out.println("10. Price of Cilantro: Rs. 60/kg");
System.out.println("Enter you choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
if(ch1==1||ch1==3||ch1==7)
amt= qnt*40;
if(ch1==2||ch1==5||ch1==8)
amt= qnt*30;
if(ch1==4||ch1==6||ch1==9||ch1==10)
amt= qnt*60;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
System.out.println("1. Price of Carrots: Rs. 80/kg");
System.out.println("2. Price of Potatoes: Rs. 30/kg");
System.out.println("3. Price of Sweet Potatoes: Rs. 60/kg");
System.out.println("4. Price of Radishes: Rs. 80/kg");
System.out.println("5. Price of Turnips: Rs. 60/kg");
System.out.println("6. rice of Beets: Rs. 80/kg");
System.out.println("7. Price of Parsnips: Rs. 80/kg");
System.out.println("8. Price of Rutabagas: Rs. 60/kg");
System.out.println("9. Price of Onions: Rs. 30/kg");
System.out.println("10. Price of Spring Onion: Rs. 30/kg");
System.out.println("Enter you choice");
ch2=in.nextInt();
11
System.out.println("Enter quantity");
qnt2=in.nextInt();
if(ch2==2||ch2==9||ch2==10)
amt= qnt2*30;
if(ch2==1||ch2==4||ch2==6||ch2==7)
amt= qnt2*80;
if(ch2==3||ch2==5||ch2==8)
amt= qnt2*60;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 3:
System.out.println("1. Price of Broccoli: Rs. 80/kg");
System.out.println("2. Price of Cauliflower: Rs. 60/kg");
System.out.println("3. Price of Cabbage: Rs. 40/kg");
System.out.println("4. rice of Brussels sprouts: Rs. 80/kg");
System.out.println("5. Price of Bok choy: Rs. 80/kg");
System.out.println("6. Price of Kale: Rs. 60/kg");
System.out.println("7. Rice of Collard greens: Rs. 80/kg");
System.out.println("8. Price of Arugula: Rs. 60/kg");
System.out.println("9. Price of Radish: Rs. 40/kg");
System.out.println("10. Price of Turnip: Rs. 40/kg");
System.out.println("Enter you choice");
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==1||ch3==4||ch3==5||ch3==7)
amt= qnt3*80;
if(ch3==2||ch3==6||ch3==8)
amt= qnt3*60;
if(ch3==3||ch3==9||ch3==10)
12
amt= qnt3*40;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
System.out.println("1. Price of Zucchini: Rs. 45/kg");
System.out.println("2. Price of Pumpkins: Rs. 45/kg");
System.out.println("3. Price of Acorn Squash: Rs. 45/kg");
System.out.println("4. Price of Spaghetti Squash: Rs. 50/kg");
System.out.println("5. Price of Delicata Squash: Rs. 60/kg");
System.out.println("6. Price of Kabocha Squash: Rs. 50/kg");
System.out.println("7. Price of Hubbard Squash: Rs. 60/kg");
System.out.println("8. Price of Butternut Squash: Rs. 50/kg");
System.out.println("9. Price of Spaghetti Squash: Rs. 50/kg");
System.out.println("10. Price of Pattypan squash: Rs. 60/kg");
System.out.println("Enter you choice");
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==2||ch4==3)
amt= qnt4*45;
if(ch4==4||ch4==6||ch4==8||ch4==9)
amt= qnt4* 50;
if(ch4==5||ch4==7||ch4==10)
amt= qnt4*60;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1. Price of Garlic: Rs. 150/kg");
13
System.out.println("2. Price of Onions: Rs. 40/kg");
System.out.println("3. Price of Shallots: Rs. 150/kg");
System.out.println("4. Price of Leeks: Rs. 80/kg");
System.out.println("5. Price of Scallions: Rs. 80/kg");
System.out.println("6. Price of Chives: Rs. 150/kg");
System.out.println("7. Price of Red Onion: Rs. 40/kg");
System.out.println("8. Price of Yellow Onion: Rs. 40/kg");
System.out.println("9. Price of Spring Onion: Rs. 80/kg");
System.out.println("10. Price of Ramsons: Rs. 80/kg");
System.out.println("Enter you choice");
ch5=in.nextInt();
System.out.println("Enter quantity");
qnt5=in.nextInt();
if(ch5==1||ch5==3||ch5==6)
amt= qnt5 *150;
if(ch5==2||ch5==7||ch5==8)
amt= qnt5*40;
if(ch5==4||ch5==5||ch5==9||ch5==10)
amt= qnt5*80;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
default:
System.out.println("Wrong Choice !!!");
}
break;
case 3:
System.out.println("===== Dairy Products =====");
System.out.println("1. Milk");
System.out.println("2. Cheese");
System.out.println("3. Yogurt");
14
System.out.println("4. Ice Cream");
System.out.println("5. Butter");
System.out.println("Please select a subcategory: ");
sc_ch3=in.nextInt();
switch(sc_ch3)
{
case 1:
System.out.println("1. Fresh Milk: Rs. 30/Ltr");
System.out.println("2. Buttermilk: Rs. 30/Ltr");
System.out.println("3. Flavored Milk: Rs. 40Ltr");
System.out.println("4. Organic Milk: Rs. 40/Ltr");
System.out.println("5. Almond Milk: Rs. 100/Ltr");
System.out.println("6. Soy Milk: Rs. 100/Ltr");
System.out.println("7. Cashew Milk: Rs. 100/Ltr");
System.out.println("8. Coconut Milk: Rs. 100/Ltr");
System.out.println("9. Oat Milk: Rs. 40/Ltr");
System.out.println("10. Tonned Milke: Rs. 30/Ltr");
System.out.println("Enter you choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
if(ch1==1||ch1==2||ch1==10)
amt=qnt* 30;
if(ch1==3||ch1==4||ch1==9)
amt=qnt* 40;
if(ch1==5||ch1==6||ch1==7||ch1==8)
amt= qnt* 100;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
15
System.out.println("1. Cheddar Cheese: Rs. 250/kg");
System.out.println("2. Parmesan Cheese: Rs. 250/kg");
System.out.println("3. Mozzarella Cheese: Rs. 350/kg");
System.out.println("4. Swiss Cheese: Rs. 250/kg");
System.out.println("5. Brie Cheese: Rs. 350/kg");
System.out.println("6. Feta Cheese: Rs. 200/kg");
System.out.println("7. Gouda Cheese: Rs. 200/kg");
System.out.println("8. Blue Cheese: Rs. 350/kg");
System.out.println("9. Camembert Cheese: Rs. 450/kg");
System.out.println("10. Goat Cheese: Rs. 450/kg");
System.out.println("Enter you choice");
ch2=in.nextInt();
System.out.println("Enter quantity");
qnt2=in.nextInt();
if(ch2==1||ch2==2||ch2==4)
amt= qnt2*250;
if(ch2==3||ch2==5||ch2==8)
amt= qnt2* 350;
if(ch2==6||ch2==7)
amt= qnt2* 200;
if(ch2==9||ch2==10)
amt= qnt2* 450;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 3:
System.out.println("1. Plain Yogurt: Rs. 45");
System.out.println("2. Greek Yogurt: Rs. 45");
System.out.println("3. Strawberry Yogurt: Rs. 50");
System.out.println("4. Blueberry Yogurt: Rs. 50");
System.out.println("5. Vanilla Yogurt: Rs. 45");
16
System.out.println("6. Honey Yogurt: Rs. 55");
System.out.println("7. Coconut Yogurt: Rs. 70");
System.out.println("8. Almond Yogurt: Rs. 70");
System.out.println("9. Raspberry Yogurt: Rs. 55");
System.out.println("10. Mixed Berry Yogurt: Rs. 55");
System.out.println("Enter you choice");
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==1||ch3==2||ch3==5)
amt= qnt3*45;
if(ch3==3||ch3==4)
amt= qnt3*50;
if(ch3==6||ch3==9||ch3==10)
amt= qnt3*55;
if(ch3==7||ch3==8)
amt= qnt3*70;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
System.out.println("1. Vanilla Ice Cream: Rs. 30");
System.out.println("2. Chocolate Ice Cream: Rs. 40");
System.out.println("3. Strawberry Ice Cream: Rs. 30");
System.out.println("4. Mint Chocolate Chip Ice Cream: Rs. 55");
System.out.println("5. Butter Pecan Ice Cream: Rs. 50");
System.out.println("6. Cookie Dough Ice Cream: Rs. 50");
System.out.println("7. Rocky Road Ice Cream: Rs. 55");
System.out.println("8. Coffee Ice Cream: Rs. 40");
System.out.println("9. Neapolitan Ice Cream: Rs. 55");
System.out.println("10. Salted Caramel Ice Cream: Rs. 50");
17
System.out.println("Enter you choice");
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==3)
amt= qnt4*30;
if(ch4==2||ch4==8)
amt= qnt4*40;
if(ch4==4||ch4==7||ch4==9)
amt= qnt4*55;
if(ch4==5||ch4==6||ch4==10)
amt= qnt4*50;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1. Salted Butter: Rs. 400/kg");
System.out.println("2. Unsalted Butter: Rs. 450/kg");
System.out.println("3. Clarified Butter: Rs. 400/kg");
System.out.println("4. Whipped Butter: Rs. 600/kg");
System.out.println("5. Garlic Butter: Rs. 450/kg");
System.out.println("6. Honey Butter: Rs. 600/kg");
System.out.println("7. Truffle Butter: Rs. 700/kg");
System.out.println("8. Cinnamon Butter: Rs. 600/kg");
System.out.println("9. Maple Butter: Rs. 700/kg");
System.out.println("10. Pumpkin Spice Butter: Rs. 700/kg");
System.out.println("Enter you choice");
ch5=in.nextInt();
System.out.println("Enter quantity");
qnt5=in.nextInt();
if(ch5==1||ch5==3)
18
amt= qnt5*400;
if(ch5==2||ch5==5)
amt= qnt5*450;
if(ch5==4||ch5==6||ch5==8)
amt= qnt5*600;
if(ch5==7||ch5==9||ch5==10)
amt= qnt5*700;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
default:
System.out.println("Wrong Choice !!!");
}
break;
case 4:
System.out.println("===== Meat and Poultry =====");
System.out.println("1.Red Meat");
System.out.println("2.Poultry");
System.out.println("3.Fish");
System.out.println("4.Processed Meat");
System.out.println("5.Turkey");
System.out.println("Please select a subcategory: ");
sc_ch4=in.nextInt();
switch (sc_ch4)
{
case 1:
System.out.println("1. : Rs. 100");
System.out.println("2. Beef: Rs. 200");
System.out.println("3. : Rs. 150");
System.out.println("4. Goat: Rs. 200");
System.out.println("5. Venison: Rs. 100");
19
System.out.println("6. Veal: Rs. 200");
System.out.println("7. Mutton: Rs. 100");
System.out.println("8. Buff: Rs. 150");
System.out.println("Enter you choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
if(ch1==1||ch1==5||ch1==7)
amt=qnt *100;
if(ch1==2||ch1==4||ch1==6)
amt=qnt *200;
if(ch1==3||ch1==8)
amt=qnt *150;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
System.out.println("1. : Rs. 100");
System.out.println("2. Turkey: Rs. 150");
System.out.println("3. Duck: Rs. 130");
System.out.println("4. Goose: Rs. 130");
System.out.println("5. Guinea Fowl: Rs. 100");
System.out.println("6. Japanese Quail: Rs. 150");
System.out.println("7. Ham: Rs. 200");
System.out.println("8. Emu: Rs. 200");
System.out.println("9. Partridge: Rs. 150");
System.out.println("10. Loin: Rs. 200");
System.out.println("Enter you choice");
ch2=in.nextInt();
System.out.println("Enter quantity");
qnt2=in.nextInt();
20
if(ch2==1||ch2==5)
amt= qnt2*100;
if(ch2==2||ch2==6||ch2==9)
amt= qnt2*100;
if(ch2==3||ch2==4)
amt= qnt2*100;
if(ch2==7||ch2==8||ch2==10)
amt= qnt2*100;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 3:
System.out.println("1. Alaskan Salmon: Rs. 120");
System.out.println("2. Cod: Rs. 150");
System.out.println("3. Mackerel: Rs. 120");
System.out.println("4. Sardines: Rs. 120");
System.out.println("5. Tuna : Rs. 150");
System.out.println("6. Surmai: Rs. 150");
System.out.println("7. Rohu : Rs. 200");
System.out.println("8. Katla: Rs. 200");
System.out.println("9. Pompfret: Rs. 150");
System.out.println("10. Bhangra: Rs. 200");
System.out.println("Enter you choice");
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==1||ch3==3||ch3==4)
amt= qnt3*120;
if(ch3==2||ch3==5||ch3==6||ch3==9)
amt= qnt3* 150;
if(ch3==7||ch3==8||ch3==10)
21
amt= qnt3*200;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
System.out.println("1. Ham: Rs. 180");
System.out.println("2. Sausage: Rs. 220");
System.out.println("3. Cream n' Onion Sausage: Rs. 180");
System.out.println("4. Pepperoni: Rs. 220");
System.out.println("5. Salami: Rs. 180");
System.out.println("6. Beef Jerky: Rs. 180");
System.out.println("7. Bacon: Rs. 220");
System.out.println("8. Corned Beef: Rs. 220");
System.out.println("9. Chicken Nuggets: Rs. 180");
System.out.println("10. Canned Sardines: Rs. 180");
System.out.println("Enter you choice");
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==3||ch4==5||ch4==6||ch4==9||ch4==10)
amt= qnt4*180;
if(ch4==2||ch4==4||ch4==7||ch4==6)
amt= qnt4*220;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1. Ground Turkey: Rs. 120");
System.out.println("2. Turkey Breast: Rs. 150");
System.out.println("3. Turkey Wings: Rs. 120");
22
System.out.println("4. Turkey Thighs: Rs. 120");
System.out.println("5. Turkey Drumsticks: Rs. 100");
System.out.println("6. Turkey Sausages: Rs. 100");
System.out.println("7. Turkey Burger Patties: Rs. 100");
System.out.println("8. Turkey Meatballs: Rs. 150");
System.out.println("9. Turkey Bacon: Rs. 100");
System.out.println("10. Ground Turkey Breast: Rs. 100");
System.out.println("Enter you choice");
ch5=in.nextInt();
System.out.println("Enter quantity");
qnt5=in.nextInt();
if(ch5==1||ch5==3||ch5==4)
amt= qnt5*120;
if(ch5==2||ch5==8)
amt= qnt5*150;
if(ch5==5||ch5==6||ch5==7||ch5==9||ch5==10)
amt= qnt5*100;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
default:
System.out.println("Wrong Choice !!!");
}
break;
case 5:
System.out.println("===== Bakery =====");
System.out.println("1.Cakes");
System.out.println("2.Breads & Buns");
System.out.println("3.Cookies");
System.out.println("4.Pastries");
System.out.println("5.Muffins");
23
System.out.println("Please select a subcategory: ");
sc_ch5=in.nextInt();
switch (sc_ch5)
{
case 1:
System.out.println("1.Dark Chocolate Cake 600 Rs.");
System.out.println("2.Cotton Candy Cake 600 Rs.");
System.out.println("3.Kit Kat Cake 650 Rs.");
System.out.println("4.Blueberry Cheesecake 650 Rs.");
System.out.println("5.Jamuca Mousse Royale 800 Rs.");
System.out.println("6.Cookies n' Cream 650 Rs.");
System.out.println("7.Chocolate Almond Fudge 800 Rs.");
System.out.println("8.Black Forest 500 Rs.");
System.out.println("9.White Forest 500 Rs.");
System.out.println("10.Strawberry Cake 550 Rs.");
System.out.println("Enter you choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
if(ch1==1||ch1==8||ch1==10)
amt= qnt*50;
if(ch1==2||ch1==3)
amt= qnt*70;
if(ch1==4||ch1==5||ch1==6)
amt= qnt*100;
if(ch1==7||ch1==9)
amt= qnt*150;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
24
System.out.println("Welcome to Breads & Buns");
System.out.println("1.White Bread 50 Rs.");
System.out.println("2.Brown Bread 50 Rs.");
System.out.println("3.Burger Bun 50 Rs.");
System.out.println("4.Pav 30 Rs.");
System.out.println("5.Pizza Base 30 Rs.");
System.out.println("6.Milk Bread 50 Rs.");
System.out.println("7.Whole Wheat Bread 80 Rs.");
System.out.println("8.Multi Grain Bread 80 Rs.");
System.out.println("9.Sweet Bun 50 Rs.");
System.out.println("10.Garlic Bread 80 Rs.");
System.out.println("Enter you choice");
ch2=in.nextInt();
System.out.println("Enter quantity");
qnt2=in.nextInt();
if(ch2==1||ch2==7||ch2==8||ch2==9)
amt= qnt2*150;
if(ch2==2||ch2==5||ch2==6||ch2==10)
amt= qnt2*120;
if(ch2==3||ch2==4)
amt= qnt2*80;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 3:
System.out.println("Welcome to Biscuits & Cookies ");
System.out.println("1.Jeera Cookies 150 Rs.");
System.out.println("2.Cashew Cookies 200 Rs.");
System.out.println("3.Chocolate Cookies 150 Rs.");
System.out.println("4.Tooti Fruity Biscuits 150 Rs.");
System.out.println("5.Osmania Cookies 100 Rs.");
25
System.out.println("6.Coconut Biscuits 100 Rs.");
System.out.println("7.Chocochip Cookies 150 Rs.");
System.out.println("8.Peanut Butter Cookies 100 Rs.");
System.out.println("9.Nankhatai Cookies 150 Rs.");
System.out.println("10.Chocochip Bana Cookies 200 Rs.");
System.out.println("Enter you choice");
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==1||ch3==4||ch3==7||ch3==10)
amt= qnt3*220;
if(ch3==2||ch3==5||ch3==8)
amt= qnt3*240;
if(ch3==3||ch3==6||ch3==9)
amt= qnt3*280;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
System.out.println("1.Chocolate Truffle 150 Rs.");
System.out.println("2.Butterscotch 100 Rs.");
System.out.println("3.Red Velvet 150 Rs.");
System.out.println("4.ChocoChip 100 Rs.");
System.out.println("5.Kit Kat 200 Rs.");
System.out.println("6.Nutella 200 Rs.");
System.out.println("7.Ferrero Rocher 280 Rs.");
System.out.println("8.Choco Walnut 150 Rs.");
System.out.println("9.Pineapple 100 Rs.");
System.out.println("10.Mango 100 Rs.");
System.out.println("10. Butter Cookies: Rs. 25");
System.out.println("Enter you choice");
26
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==4||ch4==7)
amt= qnt4*20;
if(ch4==2||ch4==5||ch4==10)
amt= qnt4*25;
if(ch4==3||ch4==6||ch4==8||ch4==9)
amt= qnt4*40;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1.Blueberry 200 Rs.");
System.out.println("2.Lemon Mousse 170 Rs.");
System.out.println("3.Raspberry 200 Rs.");
System.out.println("4.Chocolate 200 Rs.");
System.out.println("5.Peanut Butter 170 Rs.");
System.out.println("6.Strawberry 170 Rs.");
System.out.println("7.Cookies n' Cream 220 Rs.");
System.out.println("8.Snickers Cheesecake 220 Rs.");
System.out.println("9.Chocolate Caramel 250 Rs.");
System.out.println("10.Cinnabon Cheesecake 250 Rs.");
System.out.println("Enter you choice");
ch5=in.nextInt();
System.out.println("Enter quantity");
qnt5=in.nextInt();
amt=qnt5*100;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
27
break;
default:
System.out.println("Wrong Choice !!!");
}
break;
case 6:
System.out.println("===== Beverages =====");
System.out.println("1. Soft Drinks");
System.out.println("2. Juice");
System.out.println("3. Energy Drinks");
System.out.println("4. Coffee");
System.out.println("5. Tea ");
System.out.println("Please select a subcategory: ");
sc_ch6=in.nextInt();
switch (sc_ch6)
{
case 1:
System.out.println("1. Cola: Rs. 20");
System.out.println("2. Lemon-Lime Soda: Rs. 20");
System.out.println("3. Orange Soda: Rs. 20");
System.out.println("4. Ginger Ale: Rs. 30");
System.out.println("5. Root Beer: Rs. 30");
System.out.println("6. Iced Tea: Rs. 30");
System.out.println("7. Fruit Punch: Rs. 40");
System.out.println("8. Energy Drink: Rs. 40");
System.out.println("9. Lemonade: Rs. 40");
System.out.println("10. Sparkling Water: Rs. 20");
System.out.println("Enter you choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
if(ch1==1||ch1==2||ch1==3||ch1==10)
28
amt= qnt*20;
if(ch1==4||ch1==5||ch1==6)
amt= qnt*30;
if(ch1==7||ch1==8||ch1==9)
amt= qnt*40;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
System.out.println("1. Orange Juice: Rs. 35");
System.out.println("2. Apple Juice: Rs. 35");
System.out.println("3. Cranberry Juice: Rs. 35");
System.out.println("4. Grapefruit Juice: Rs. 35");
System.out.println("5. Tomato Juice: Rs. 35");
System.out.println("6. Pineapple Juice: Rs. 35");
System.out.println("7. Mango Juice: Rs. 35");
System.out.println("8. Pomegranate Juice: Rs. 35");
System.out.println("9. Cucumber Juice: Rs. 35");
System.out.println("10. Watermelon Juice: Rs. 35");
System.out.println("Enter you choice");
ch2=in.nextInt();
System.out.println("Enter quantity");
qnt2=in.nextInt();
amt= qnt2*35;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 3:
System.out.println("1. Red Bull Energy Drink: Rs. 120");
System.out.println("2. Monster Energy Drink: Rs. 80");
29
System.out.println("3. Rockstar Energy Drink: Rs. 80");
System.out.println("4. Bang Energy Drink: Rs. 60");
System.out.println("5. NOS Energy Drink: Rs. 60");
System.out.println("6. Full Throttle Energy Drink: Rs. 80");
System.out.println("7. Amp Energy Drink: Rs. 120");
System.out.println("8. 5-hour Energy Drink: Rs. 60");
System.out.println("9. Guru Energy Drink: Rs. 60");
System.out.println("10. XS Energy Drink: Rs. 120");
System.out.println("Enter you choice");
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==1||ch3==7||ch3==10)
amt= qnt3*120;
if(ch3==2||ch3==3||ch3==6)
amt= qnt3*80;
if(ch3==4||ch3==5||ch3==8||ch3==9)
amt= qnt3*60;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
System.out.println("1. Espresso: Rs. 120");
System.out.println("2. Cappuccino: Rs. 140");
System.out.println("3. Latte: Rs. 160");
System.out.println("4. Americano: Rs. 140");
System.out.println("5. Mocha: Rs. 160");
System.out.println("6. Macchiato: Rs. 180");
System.out.println("7. Flat White: Rs. 120");
System.out.println("8. Irish Coffee: Rs. 180");
System.out.println("9. Vienna Coffee: Rs. 180");
30
System.out.println("10. Cold Coffee: Rs. 160");
System.out.println("Enter you choice");
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==7)
amt= qnt4*120;
if(ch4==2||ch4==4)
amt= qnt4*140;
if(ch4==3||ch4==5||ch4==10)
amt= qnt4*160;
if(ch4==6||ch4==8||ch4==9)
amt= qnt4*180;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1. Green Tea: Rs. 30");
System.out.println("2. Black Tea: Rs. 30");
System.out.println("3. Chai: Rs. 30");
System.out.println("4. Earl Grey Tea: Rs. 35");
System.out.println("5. Peppermint Tea: Rs. 35");
System.out.println("6. Lemon Tea: Rs. 35");
System.out.println("7. Rooibos Tea: Rs. 40");
System.out.println("8. Oolong Tea: Rs. 40");
System.out.println("9. Hibiscus Tea: Rs. 35");
System.out.println("10. Jasmine Tea: Rs. 35");
System.out.println("Enter you choice");
ch5=in.nextInt();
System.out.println("Enter quantity");
qnt5=in.nextInt();
31
if(ch5==1||ch5==2||ch5==3)
amt= qnt5*30;
if(ch5==4||ch5==5||ch5==6||ch5==9||ch5==10)
amt= qnt5*35;
if(ch5==7||ch5==8)
amt= qnt5*40;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
default:
System.out.println("Wrong Choice !!!");
}
break;
case 7:
System.out.println("===== Snacks =====");
System.out.println("1. Chips and Crackers");
System.out.println("2. Energy Bars");
System.out.println("3. Candy and Chocolate");
System.out.println("4. Popcorn");
System.out.println("5. Dried Fruits ");
System.out.println("Please select a subcategory: ");
sc_ch7=in.nextInt();
switch (sc_ch7)
{
case 1:
System.out.println("1. Potato Chips: Rs. 20");
System.out.println("2. Tortilla Chips: Rs. 35");
System.out.println("3. Popcorn: Rs. 20");
System.out.println("4. Pretzels: Rs. 35");
System.out.println("5. Cheese Crackers: Rs. 30");
System.out.println("6. Rice Crackers: Rs. 30");
32
System.out.println("7. Saltine Crackers: Rs. 20");
System.out.println("8. Wheat Thins: Rs. 35");
System.out.println("9. Corn Chips: Rs. 30");
System.out.println("10. Pita Chips: Rs. 35");
System.out.println("Enter you choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
if(ch1==1||ch1==3||ch1==7)
amt= qnt*20;
if(ch1==2||ch1==4||ch1==8||ch1==10)
amt= qnt*35;
if(ch1==5||ch1==6||ch1==9)
amt= qnt*30;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
System.out.println("1. Clif Bar: Rs. 35");
System.out.println("2. Luna Bar: Rs. 35");
System.out.println("3. Kind Bar: Rs. 35");
System.out.println("4. RXBAR: Rs. 35");
System.out.println("5. Quest Bar: Rs. 35");
System.out.println("6. PowerBar: Rs. 35");
System.out.println("7. Gatorade Protein Bar: Rs. 35");
System.out.println("8. ThinkThin Bar: Rs. 35");
System.out.println("9. Nature Valley Bar: Rs. 35");
System.out.println("10. Kashi Bar: Rs. 35");
System.out.println("Enter you choice");
ch2=in.nextInt();
System.out.println("Enter quantity");
33
qnt2=in.nextInt();
amt= qnt2*35;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 3:
System.out.println("1. M&M's Candy: Rs. 50");
System.out.println("2. Kit Kat Chocolate Bar: Rs. 25");
System.out.println("3. Reese's Peanut Butter Cups: Rs. 40");
System.out.println("4. Twix Chocolate Bar: Rs. 50");
System.out.println("5. Skittles Candy: Rs. 40");
System.out.println("6. Hershey's Chocolate Bar: Rs. 25");
System.out.println("7. Haribo Gummy Bears: Rs. 40");
System.out.println("8. Milky Way Chocolate Bar: Rs. 25");
System.out.println("9. Starburst Candy: Rs. 50");
System.out.println("10. Munch Bar: Rs. 25");
System.out.println("Enter you choice");
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==1||ch3==4||ch3==9)
amt= qnt3*50;
if(ch3==2||ch3==6||ch3==8||ch3==10)
amt= qnt3*25;
if(ch3==3||ch3==5||ch3==7)
amt= qnt3*40;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
34
System.out.println("1. Butter Popcorn: Rs. 35");
System.out.println("2. Caramel Popcorn: Rs. 45");
System.out.println("3. Cheddar Popcorn: Rs. 45");
System.out.println("4. Kettle Corn: Rs. 35");
System.out.println("5. White Cheddar Popcorn: Rs. 55");
System.out.println("6. Movie Theater Popcorn: Rs. 55");
System.out.println("7. Garlic Parmesan Popcorn: Rs. 45");
System.out.println("8. Buffalo Ranch Popcorn: Rs. 55");
System.out.println("9. Jalapeno Popcorn: Rs. 45");
System.out.println("10. Sour Cream & Onion Popcorn: Rs. 35");
System.out.println("Enter you choice");
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==4||ch4==10)
amt=qnt4*35;
if(ch4==2||ch4==3||ch4==7||ch4==9)
amt=qnt4*45;
if(ch4==5||ch4==6||ch4==8)
amt=qnt4*55;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1. Raisins: Rs. 450");
System.out.println("2. Apricots: Rs. 500");
System.out.println("3. Dates: Rs. 400");
System.out.println("4. Figs: Rs. 400");
System.out.println("5. Prunes: Rs. 500");
System.out.println("6. Walnuts: Rs. 550");
System.out.println("7. Almonds: Rs. 550");
35
System.out.println("8. Pinea: Rs. 500");
System.out.println("9. Kashew: Rs. 450");
System.out.println("10. Pistachio: Rs. 550");
System.out.println("Enter you choice");
ch5=in.nextInt();
System.out.println("Enter quantity");
qnt5=in.nextInt();
if(ch5==1||ch5==9)
amt= qnt5*450;
if(ch5==2||ch5==5||ch5==8)
amt= qnt5*500;
if(ch5==3||ch5==4)
amt= qnt5*400;
if(ch5==6||ch5==7||ch5==550)
amt= qnt5*550;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
default:
System.out.println("Wrong Choice !!!");
}
break;
case 8:
System.out.println("===== Canned and packaged foods =====");
System.out.println("1. Canned fruits and vegetables");
System.out.println("2. Cereals and breakfast bars");
System.out.println("3. Nuts and seeds");
System.out.println("4. Baked beans and other legumes");
System.out.println("5. Pasta and pasta sauce ");
System.out.println("Please select a subcategory: ");
sc_ch8=in.nextInt();
36
switch (sc_ch8)
{
case 1:
System.out.println("1. Beans: Rs. 100");
System.out.println("2. Beets: Rs. 120");
System.out.println("3. Carrots: Rs. 130");
System.out.println("4. Corn: Rs. 100");
System.out.println("5. Peans: Rs. 120");
System.out.println("6. Green beans: Rs. 130");
System.out.println("7. Tomatoes: Rs. 100");
System.out.println("8. Carrots: Rs. 120");
System.out.println("9. Corn kernels: Rs. 130");
System.out.println("10. Mushrooms: Rs. 100");
System.out.println("Enter you choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
if(ch1==1||ch1==4||ch1==7||ch1==10)
amt= qnt*100;
if(ch1==2||ch1==5||ch1==8)
amt= qnt*120;
if(ch1==3||ch1==6||ch1==9)
amt= qnt*130;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
System.out.println("1. Rice: Rs. 60");
System.out.println("2. Barley: Rs. 80");
System.out.println("3. Rye: Rs. 100");
System.out.println("4. Corn: Rs. 60");
37
System.out.println("5. Wheat: Rs. 80");
System.out.println("6. Birdseed: Rs. 100");
System.out.println("7. Sorghum: Rs. 60");
System.out.println("8. Triticale: Rs. 80");
System.out.println("9. Burgundy wheat: Rs. 100");
System.out.println("10. Spelt: Rs. 60");
System.out.println("Enter you choice");
ch2=in.nextInt();
System.out.println("Enter quantity");
qnt2=in.nextInt();
if(ch2==1||ch2==4||ch2==7||ch2==10)
amt= qnt2*60;
if(ch2==2||ch2==5||ch2==8)
amt= qnt2*80;
if(ch2==3||ch2==6||ch2==9)
amt= qnt2*100;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 3:
System.out.println("1. Cashew: Rs. 450");
System.out.println("2. Pistachios: Rs. 500");
System.out.println("3. Pecans: Rs. 550");
System.out.println("4. Almonds: Rs. 550");
System.out.println("5. Macadamia nuts: Rs. 500");
System.out.println("6. Brazil nuts: Rs. 500");
System.out.println("7. Peanuts: Rs. 450");
System.out.println("8. Walnuts: Rs. 450");
System.out.println("9. Hazelnuts: Rs. 550");
System.out.println("10. Chestnuts: Rs. 500");
System.out.println("Enter you choice");
38
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==1||ch3==7||ch3==8)
amt= qnt3*450;
if(ch3==2||ch3==5||ch3==6||ch3==10)
amt= qnt3*500;
if(ch3==3||ch3==4||ch3==9)
amt= qnt3*550;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
System.out.println("1. Chickpeas: Rs. 350");
System.out.println("2. Black beans: Rs. 400");
System.out.println("3. Green peas: Rs. 450");
System.out.println("4. Lima beans: Rs. 350");
System.out.println("5. Kidney beans: Rs. 400");
System.out.println("6. Black-eyed beans: Rs. 450");
System.out.println("7. Navy beans: Rs. 350");
System.out.println("8. Pinto beans: Rs. 400");
System.out.println("9. Soy beans: Rs. 450");
System.out.println("10. Lentils: Rs. 350");
System.out.println("Enter you choice");
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==4||ch4==7||ch4==10)
amt= qnt4*350;
if(ch4==2||ch4==5||ch4==8)
amt= qnt4*400;
39
if(ch4==3||ch4==6||ch4==9)
amt= qnt4*450;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1. Spaghetti: Rs. 250");
System.out.println("2. Long pasta: Rs. 300");
System.out.println("3. Fettuccine: Rs. 350");
System.out.println("4. Linguine: Rs. 250");
System.out.println("5. Penne: Rs. 300");
System.out.println("6. Rigatoni: Rs. 350");
System.out.println("7. Macaroni: Rs. 250");
System.out.println("8. Farfalle: Rs. 300");
System.out.println("9. Risoni: Rs. 350");
System.out.println("10. Rotini: Rs. 250");
System.out.println("Enter you choice");
ch5=in.nextInt();
System.out.println("Enter quantity");
qnt5=in.nextInt();
if(ch5==1||ch5==4||ch5==7||ch5==10)
amt= qnt5*250;
if(ch5==2||ch5==5||ch5==8)
amt= qnt5*300;
if(ch5==3||ch5==6||ch5==9)
amt= qnt5*350;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
default:
40
System.out.println("Wrong Choice !!!");
}
break;
case 9:
System.out.println("===== Personal care =====");
System.out.println("1. Skin care");
System.out.println("2. Hair care");
System.out.println("3. Oral care");
System.out.println("4. Body care");
System.out.println("5. Bath and Shower");
System.out.println("Please select a subcategory: ");
sc_ch9=in.nextInt();
switch (sc_ch9)
{
case 1:
System.out.println("1. Face Wash: Rs. 150");
System.out.println("2. Moisturizer: Rs. 200");
System.out.println("3. Sunscreen: Rs. 200");
System.out.println("4. Lip Balm: Rs. 150");
System.out.println("5. Body Lotion: Rs. 250");
System.out.println("6. Hand Cream: Rs. 250");
System.out.println("7. Facial Serum: Rs. 200");
System.out.println("8. Eye Cream: Rs. 150");
System.out.println("9. Facial Oil: Rs. 250");
System.out.println("10. Cleansing Wipes: Rs. 200");
System.out.println("Enter you choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
if(ch1==1||ch1==4||ch1==8)
amt= qnt*150;
if(ch1==2||ch1==7||ch1==10||ch1==3)
41
amt= qnt*200;
if(ch1==5||ch1==6||ch1==9)
amt= qnt*250;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
System.out.println("1.ggg Shampoo: Rs. 250");
System.out.println("2. Conditioner: Rs. 250");
System.out.println("3. Hair Oil: Rs. 300");
System.out.println("4. Hair Serum: Rs. 350");
System.out.println("5. Hair Mask: Rs. 250");
System.out.println("6. Hair Spray: Rs. 350");
System.out.println("7. Hair Gel: Rs. 300");
System.out.println("8. Hair Mousse: Rs. 250");
System.out.println("9. Dry Shampoo: Rs. 350");
System.out.println("10. Hair Color: Rs. 300");
System.out.println("Enter you choice");
ch2=in.nextInt();
System.out.println("Enter quantity");
qnt2=in.nextInt();
if(ch2==1||ch2==2||ch2==5||ch2==8)
amt= qnt2*250;
if(ch2==3||ch2==7||ch2==10)
amt= qnt2*250;
if(ch2==4||ch2==6||ch2==9)
amt= qnt2*250;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
42
case 3:
System.out.println("1. Toothbrush: Rs. 50");
System.out.println("2. Toothpaste: Rs. 70");
System.out.println("3. Mouthwash: Rs. 70");
System.out.println("4. Dental Floss: Rs. 50");
System.out.println("5. Tongue Scraper: Rs. 50");
System.out.println("6. Teeth Whitening Strips: Rs. 70");
System.out.println("7. Sugar-Free Gum: Rs. 75");
System.out.println("8. Oral Probiotics: Rs. 75");
System.out.println("9. Denture Cleaner: Rs. 75");
System.out.println("10. Orthodontic Wax: Rs. 75");
System.out.println("Enter you choice");
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==1|ch3==4||ch3==5)
amt= qnt3*50;
if(ch3==2||ch3==3||ch3==6)
amt= qnt3*70;
if(ch3==7||ch3==8||ch3==9||ch3==10)
amt= qnt3*75;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
System.out.println("1. Body Wash: Rs. 220");
System.out.println("2. Body Lotion: Rs. 240");
System.out.println("3. Body Scrub: Rs. 150");
System.out.println("4. Body Butter: Rs. 240");
System.out.println("5. Hand Cream: Rs. 220");
System.out.println("6. Foot Cream: Rs. 150");
43
System.out.println("7. Deodorant: Rs. 220");
System.out.println("8. Body Oil: Rs. 240");
System.out.println("9. Sunscreen: Rs. 150");
System.out.println("10. Body moisturizer: Rs. 240");
System.out.println("Enter you choice");
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==5||ch4==7)
amt= qnt4*220;
if(ch4==2||ch4==4||ch4==8||ch4==10)
amt= qnt4*240;
if(ch4==3||ch4==6||ch4==9)
amt= qnt4*150;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1. Body Wash: Rs. 350");
System.out.println("2. Shower Gel: Rs. 350");
System.out.println("3. Bar Soap: Rs. 250");
System.out.println("4. Body Scrub: Rs. 250");
System.out.println("5. Bath Bombs: Rs. 450");
System.out.println("6. Bath Salts: Rs. 450");
System.out.println("7. Bubble Bath: Rs. 450");
System.out.println("8. Shower Oil: Rs. 350");
System.out.println("9. Body Polish: Rs. 350");
System.out.println("10. Shower Steamers: Rs. 250");
System.out.println("Enter you choice");
ch5=in.nextInt();
System.out.println("Enter quantity");
44
qnt5=in.nextInt();
if(ch5==1||ch5==2||ch5==8||ch5==9)
amt= qnt5*350;
if(ch5==3||ch5==4||ch5==10)
amt= qnt5*250;
if(ch5==5||ch5==6||ch5==7)
amt= qnt5*450;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
default:
System.out.println("Wrong Choice !!!");
}
break;
case 10:
System.out.println("\n===== Household essentials =====");
System.out.println("1. Cleaning supplies");
System.out.println("2. Laundry supplies");
System.out.println("3. Paper products");
System.out.println("4. Trash bags");
System.out.println("5. Storage and organisation");
System.out.println("Please select a subcategory: ");
sc_ch10=in.nextInt();
switch (sc_ch10)
{
case 1:
System.out.println("1. All-Purpose Cleaner: Rs. 250");
System.out.println("2. Glass Cleaner: Rs. 250");
System.out.println("3. Bathroom Cleaner: Rs.250");
System.out.println("4. Kitchen Cleaner: Rs. 250");
System.out.println("5. Disinfecting Wipes: Rs. 250");
45
System.out.println("6. Toilet Bowl Cleaner: Rs. 250");
System.out.println("7. Floor Cleaner: Rs. 250");
System.out.println("8. Wood Polish: Rs. 250");
System.out.println("9. Stainless Steel Cleaner: Rs. 250");
System.out.println("10. Scrubbing Sponges: Rs. 250");
System.out.println("Enter you choice");
ch1=in.nextInt();
System.out.println("Enter quantity");
qnt=in.nextInt();
amt= qnt*250;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 2:
System.out.println("1. Laundry Detergent: Rs. 250");
System.out.println("2. Fabric Softener: Rs. 350");
System.out.println("3. Dryer Sheets: Rs. 150");
System.out.println("4. Bleach: Rs. 250");
System.out.println("5. Stain Remover: Rs. 350");
System.out.println("6. Laundry Pods: Rs. 150");
System.out.println("7. Wool Dryer Balls: Rs. 250");
System.out.println("8. Ironing Water: Rs. 350");
System.out.println("9. Lint Rollers: Rs. 150");
System.out.println("10. Hypoallergenic Laundry Detergent: Rs. 350");
System.out.println("Enter you choice");
ch2=in.nextInt();
System.out.println("Enter quantity");
qnt2=in.nextInt();
if(ch2==1||ch2==4||ch2==7)
amt= qnt2*250;
if(ch2==2||ch2==5||ch2==8||ch2==10)
46
amt= qnt2*350;
if(ch2==3||ch2==6||ch2==9)
amt= qnt2*150;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 3:
System.out.println("1. Toilet Paper: Rs. 100");
System.out.println("2. Paper Towels: Rs. 100");
System.out.println("3. Facial Tissues: Rs. 100");
System.out.println("4. Napkins: Rs. 100");
System.out.println("5. Disposable Plates: Rs. 100");
System.out.println("6. Disposable Cups: Rs. 80");
System.out.println("7. Aluminum Foil: Rs. 80");
System.out.println("8. Plastic Wrap: Rs. 80");
System.out.println("9. Parchment Paper: Rs. 80");
System.out.println("10. Wax Paper: Rs. 80");
System.out.println("Enter you choice");
ch3=in.nextInt();
System.out.println("Enter quantity");
qnt3=in.nextInt();
if(ch3==1||ch3==2||ch3==3||ch3==4||ch3==5)
amt= qnt3*100;
if(ch3==6||ch3==7||ch3==8||ch3==9||ch3==10)
amt= qnt3*80;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 4:
System.out.println("1. Small Trash Bags: Rs. 100");
47
System.out.println("2. Medium Trash Bags: Rs. 120");
System.out.println("3. Large Trash Bags: Rs. 140");
System.out.println("4. Extra-Large Trash Bags: Rs. 160");
System.out.println("5. Biodegradable Trash Bags: Rs. 140");
System.out.println("6. Compostable Trash Bags: Rs. 140");
System.out.println("7. Drawstring Trash Bags: Rs. 120");
System.out.println("8. Clear Trash Bags: Rs. 100");
System.out.println("9. Scented Trash Bags: Rs. 140");
System.out.println("10. Heavy-Duty Trash Bags: Rs. 160 ");
System.out.println("Enter you choice");
ch4=in.nextInt();
System.out.println("Enter quantity");
qnt4=in.nextInt();
if(ch4==1||ch4==8)
amt= qnt4* 100;
if(ch4==2||ch4==7)
amt= qnt4* 120;
if(ch4==3||ch4==5||ch4==9)
amt= qnt4* 140;
if(ch4==4||ch4==10)
amt= qnt4* 160;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
case 5:
System.out.println("1. Storage Bins: Rs. 600");
System.out.println("2. Hangers: Rs. 400");
System.out.println("3. Drawer Organizers: Rs. 450");
System.out.println("4. Closet Organizers: Rs. 450");
System.out.println("5. Under-bed Storage: Rs. 600");
System.out.println("6. Garment Rack: Rs. 450");
48
System.out.println("7. Wall Shelves: Rs. 400");
System.out.println("8. Over-the-door Organizer: Rs. 400");
System.out.println("9. Jewelry Organizer: Rs. 600");
System.out.println("10. Shoe Organizer: Rs. 600");
ch5=in.nextInt();
System.out.println("Enter quantity");
qnt5=in.nextInt();
if(ch5==1||ch5==5||ch5==9||ch5==10)
amt= qnt5*600;
if(ch5==2||ch5==7||ch5==8)
amt= qnt5*400;
if(ch5==3||ch5==4||ch5==6)
amt= qnt5*450;
totamt=totamt+amt;
System.out.println("Do you want to place more order? Enter Y/N");
choice=in.next();
break;
default:
System.out.println("Wrong Choice !!!");
}
break;
default:
System.out.println("Wrong Choice !!!");
}
}
System.out.println("The Total amount is:"+totamt);
gst=totamt*18.0/100.0;
tgst=gst+totamt;
System.out.println("The total amount with tax is:"+tgst);
System.out.println("Thank you visit again !!!");
}
}
49
Output
===== Welcome to our Grocery App =====
Please select a main category:
1. Fruits
2. Vegetables
3. Dairy products
4. Meat and poultry
5. Bakery
6. Beverages
7. Snacks
8. Canned and packaged foods
9. Personal care
10. Household essentials
1
===== Fruits =====
1. Citrus fruits
2. Berries
3. Tropical fruits
4. Melons
5. Stone fruits
Please select a subcategory:
1
1. Oranges: Rs. 80/kg
2. Lemons: Rs. 80/kg
3. Grapefruits: Rs. 90/kg
4. Lime: Rs. 90/kg
5. Mandarian: Rs. 100/kg
6. Tangerine: Rs. 90/kg
7. Pomelo: Rs. 80/kg
8. Yuzu: Rs. 120/kg
9. Bergamot: Rs. 120/kg
50
10. Citron: Rs. 100/kg
Enter your choice
4
Enter quantity
1
Do you want to place more order? Enter Y/N
y
Please select a main category:
1. Fruits
2. Vegetables
3. Dairy products
4. Meat and poultry
5. Bakery
6. Beverages
7. Snacks
8. Canned and packaged foods
9. Personal care
10. Household essentials
6
===== Beverages =====
1. Soft Drinks
2. Juice
3. Energy Drinks
4. Coffee
5. Tea
Please select a subcategory:
3
1. Red Bull Energy Drink: Rs. 120
2. Monster Energy Drink: Rs. 80
3. Rockstar Energy Drink: Rs. 80
4. Bang Energy Drink: Rs. 60
5. NOS Energy Drink: Rs. 60
51
6. Full Throttle Energy Drink: Rs. 80
7. Amp Energy Drink: Rs. 120
8. 5-hour Energy Drink: Rs. 60
9. Guru Energy Drink: Rs. 60
10. XS Energy Drink: Rs. 120
Enter you choice
1
Enter quantity
1
Do you want to place more order? Enter Y/N
n
The Total amount is:210
The total amount with tax is:247.8
Thank you visit again !!!
52
Data Description Table
53
Integer sc_ch7 to accept choice for 7th sub-menu
Integer sc_ch8 to accept choice for 8th sub-menu
Integer sc_ch9 to accept choice for 9th sub-menu
Integer sc_ch10 to accept choice for 10th sub-menu
54