Import.java.io.*;
class Westside
{
double cost= 0;
double s=100.0
 
 
 
 
{ case1 :
 System.out.println(“This is the Ethnic”);
System.out.println(“section and we are very glad to announce that the latest designs have just come in!!);
System.out.println(“The Ethnic section provides you a wide range of selction!!!”);
System.out.println(“we also provide sizes ranging from Small(s), Medium(m),Large(l) and extra Large(XL)
System.out.println(“Please enter the numbers according to your choice”);  
System.out.println(“Enter 1. For Saree”);
System.out.println(“2.for Pattiyallas 3.for chuddidhars 4.for  Salwar Kameez and”);
System.out.println(“5.for Kurtis 6.for ghagras”);
Int num=Integer.parseInt9std.readLine());
If(num==1)
{    name [z]=”Saree”;
      Prize [z]=900;
Z++
System.out.println(“The cost for your choice is Rs 900”);  
Cost=cost+900; }
Else
If(num==2)
{    name[z]=”pattiyallas”;
     Price[z]=500;
    z++;
System.out.println(“The cost for your choice is Rs 500”);
Cost=cost+500; } 
Else 
If(num==3)
{       name[z]=”Chuddihars”;
         Price[z]=400;
         Z++;
       System.out.println(“The cost for your choice is Rs 400”);
Cost=cost+400; }  
Else
If(num==40
{       name[z]=”Salwar Kameez”;
         Prize[z]=650;
         Z++;
System.out.println(“The cost for your choice is Rs 650”);
Cost=cost+650; }
Else
If(num==5)
{    name[z]=”Kurtis”;
     Prize[z]=150;
      Z++
System.out.println(“The cost for your choice is Rs 150; }  
Cost=cost+150;}
Else
If(num==6)
{   name[z]=”Ghagras”;
Price[z]=550;
Z++;
System.out.println(“The cost of your choice is Rs 550”);
Cost=cost+550; }  
Else
System.out.println(“Please check your input”);
Break;
Case2:  System.out.println(“tThis is the Casual Wear section and we are very glad to announce that we have received the”);
System.out.println(“latest designs.”);  
System.out.println(“The Casual Wear section provides you with wide varieties.”);
System.out.println(“We also provide sizes ranging from Small(s), Medium(m);Large(l) and Extra Large(XL).”);  
System.out.println(“Please enter the numbers according to your choice.”)  
System.out.println(“Enter 1.for Casual pants 2.for Casual shirts/t-shirts 3. For Casual skirts”);
System.out.println(“4. For sweaters/jackets 5.for Dresses.”);   
Num=Integer.parse.int(std.readLine();
If(num==1)
{  disc=599-(0.15*599);
    Name[z]=”Casual pants”;
    Price [z]=disc;
    Z++;
Cost=cost+disc;
System.out.println(“The cost for your choice is Rs 599 but after discount is Rs”+disc);
}
Else
If(num==2)
{     disc=399-(0.15*399);
      Name[z]=”Casual shirts/t-shirts”;
      Price[z]= disc;
    Z++; 
cost==cost+disc;
System.out.println(“The cost for your choice is Rs 399 but after discount it is Rs”+disc);  
}
Else
If(num==3)
{     disc=499-(0.15*499);
       Name[z]=”Casual skirts”;
       Price[z]=disc;
       Z++;
System.out.println(“The cost for your choice is Rs 299 but after discount it is Rs”+disc)
Cost=cost+disc; }  
Else
If(num==4)
{      disc=29-(0.15*299);
       Name[z]=”Sweater Jackets”
        Price[z]=disc;
     Z++;
    System.out.println(“The cost for your choice is Rs 299 but after discount it is Rs”+disc)  
Cost=cost+disc; }
Else
If(num==5)
{      disc=750-(0.15);
       Name[z]=”Dresses”;
       Price[z]=disc;
        Z++;
	System.out.println(“The cost for your choice is Rs 750 but after discount it is Rs”+disc);
Cost=cost+disc;  }   
Else
System.out.println(“Please check your input”);  
Break;
Case3:  System.out.println(“This is the Formal Wear section and very glad to announce that”);
System.out.println(“we have received the designs”);  
System.out.println(“The Formal Wear section provides you with wide varieties”); 
System.out.println(“We also provide sizes ranging from Small(s),Medium(m),Large(l)and Extra Large(XL).”);  
System.out.println(“Please enter the numbers according to your choice,”);  
System.out.println(“Enter 1.for Formal pants 2.for Formal shirts/t-shirts 3.for Formal skirts 4.for Coats.”);
Num=Integer.parse.int(std.readLine());
If(num==1)
{     name[z]=”Formal pants”;
Price[z]=599;
Z++;
System.out.println(“”The cost for your choice is Rs 599”);
Cost=cost+599; }
Else
If(num==2)
{   name[z]=”Formal shirts/t-shirts”;
 Price[z]=399;
 Z++;
System.out.println(“The cost of your choice is Rs 399”);
Cost=cost+399;  }
Else
If(num==3)
{    name[z]=”Formal skirts”;
Price[z]=499;
Z++;
System.out.println(“The cost of your choice is Rs 499”);
Cost=cost+499; }
Else
If(num==4)
{    name[z]=”coats”;
Price[z]=350;
Z++;
System.out.println(“The cost for your choice is Rs 350”);  
Else
System.out.println(“Please check your input”);  
Break;
Case 4:
System.out.println(“This is the Western Wear section and we are very glad to announce that we have received”)
System.out.println(“we are very glad to announce that we have receieved the latest designs.”);
System.out.println(“The Western Wear section provides you with wide varieties from the Western sides itself.”);  
System.out.println(“We also provide sizes ranging from Smal(s),Medium(m),Large(l)and Extra Large(XL).”);
System.out.println(“Please enter the numbers according to your choice.”);  
System.out.println(“Enter 1.for Jeans(Denim) 2. for fancy tops(Sleeveless,Halter necked,Full sleeves etc.”);
Num=Integer.parseInt(std.readLine());
If(num==1)
{    name[z]=”Jeans(Denim)”;
     Price[z]=299;
      Z++;
   System.out.println(“The cost of your choice is Rs 299”);
Cost=cost+299;
Else
If(num==2)
{ name[z]=”fancy tops(Sleeves,Halter necked,Full sleeves)”;
Price[z]=199;
Z++;
System.out.println(“The cost of your choice is Rs 199”);  
Cost=cost+199;
Else
System.out.print(“Please check your input”);
Break;
System.out.println(“This is the Party Wear section !”);
System.out.println(“The Party Wear section provides you with amazing varieties of choices to choose from.”); 
System.out.println(“We also provide sizes ranging from Small(s),Medium(m),Large(l) and Extra Large(XL).”);
System.out.println(“Please enter the numbers according to your choice.”);  
System.out.println(“Enter 1.Cocktail Dresses 2. for Disco Dresses 3. For Straphles Dresses.”);
If(num==1)
{  disc=1000-(0.25*1000);
   Cost=cost+disc;
    Name[z]=”cocktail dresses”;
    Price[z]=disc;
    Z++;
System.out.println(“The cost of your choice is Rs 1000 but after discount it is Rs”+cost); } 
Else
If(num==2)
{   disc=1500-(0.25*1500);
     Cost=cost+disc;
   Name[z]=”Disco Dresses”;
Price[z]=disc;
Z++;
System.out.print(“The cost for your choice is Rs 1500 but after discount it is Rs”+cost); }
Else
If(num==3)
{   disc=2500-(0.25*2500);
    Cost=cost+disc;
    Name[z]=”Strapless dresss”;
    Price[z]=”disc”;
    Z++;
System.out.println(“The cost for your choice is Rs 2500 but after discount it is Rs”+cost); }  
System.out.println(“Please check your input”);  
Deafault: System.out.println(“Please check your input”); }  
}
Public void Men()Throws IOException
{  BufferedReader std=new BufferedReader(new InputStreamReader(System.in));
System.out.println(“Welcome to the Men’s clothing section !!!”);  
System.out.println(“We provide a wide range of section”);
System.out.println(“Kindly enter the numbers as given in the menu.”);
System.out.println(“Enter 1.for Ethnic Wear 2. For Casual Wear”);
System.out.println(3.for formal Wear 4. For Western Wear 5.for Party Wear.”);
System.out.println(“We are extremely delighted to announce that”);  
System.out.println(we provide 20% discount on all sections in the Casual Wear ! and”);
System.out.println(“25% discount on Formal Wear !”);  
Int chwo=Integer.parseInt(std.readLine());
Switch(chow)
{ case 1: System.out.println(“This is the Ethnic section and we are very glad to announce that”);  
System.out.println(“section and we are very glad to announce that the latest designs have”);
System.out.println(“just come in.”);
System.out.println(The Ethinic section provides you with its own varieties.”);
System.out.println(“We also provide sizes ranging from Small(s),Medium(m),Large(l) and Extra Large(XL).”);
System.out.println(“Please enter the numbers according to your choice.”);  
System.out.println(“Enter 1.for Kurtas 2.for Traditional Sherwanis 3.for Jodhpuri Suit 4.Kurta Pyjama.”);
Int num=Integer.parseInt(std.readLine());
If(num==1)
{  name[z]=”Kurtas”;
   Price[z]=699;
  Z++;
System.out.println(“The cost for your choice is Rs 699”);
Cost=cost+699; }
Else
If(num==2){
Name[z]=”Traditional Sherwanis”;
Price[z]=1999;
Z++;
System.out.println(“The cost for your choice is Rs 1999”);
Cost=cost+1999; }  
Else
If(num==3)
{ name[z]=”Jodhpuri Suit”;
Price[z]=2999;
Z++;
System.out.println(“The cost for your choice is Rs 1750”);
Cost=cost+1750: }  
Else
If(num==4)
{ name[z]=”Kurta Pyjama”;
   Price[z]=1750;
   Z++;
System.out.println(“The cost of your choice is Rs 1750”);  
Else
System.out.println(“Please check your input”);
Break;
System.out.println(“This is the casual Wear section and we are very glad to announce that we have received the”);
System.out.println(“”latest designs”);
System.out.println(“”The Casual Wear section provides you with wide varieties.”);
System.out.println(“ We also provide size ranging from Small(s),Medium(m),Large(l) and Extra Large(XL)”); 
System.out.println(“Please enter the numbers according to your choice.”); 
System.out.println(“Enter 1.for Casual pants”);
System.out.println(“”2. for Casual shirts 3.for Casual t-shirts 4.for sweaters/jackets 5. For Trousers/Shorts.”);
Num=Integer.parseInt(std.readLine());
If(num==1)
{ disc=1000-(0.20*1000);
Cost=cost+disc;
Name[z]=”casual pants”;
Price[z]=disc;
Z++;
System.out.println(“The cost for your choice is Rs 1000 but the discounted price is Rs”+disc); }  
Else
If(num==2)
{ disc=750-(0.25*750);
Cost=cost+disc;
Name[z]=”Casual shirts”;
Price[z]=disc;
Z++;
System.out.println(“The cost for your choice is Rs 750 but the discounted price is Rs”+disc); }  
Else
If(num==2)
{ disc=750-(0.20*750);
  Cost=cost+disc;
  Name[z]=”Casual shirts”;
  Price[z]=disc;
  Z++;
System.out.println(“The cost for your choice is Rs 750 but the discounted price is Rs”+disc); }  
Else
If(num==3)
Disc=800-(0.20*800);
Cost=cost+disc;
Name[z]=”Casual t-shirts”;
Price[z]=disc;
Z++;
System.out.println(“The cost for your choice is Rs 800 but the discounted price is Rs”+disc);}  
Else
If(num==4)
{ disc=1500-(0.20*1500);
  Cost=cost+299;
   Name[z]=”Sweaters/Jackets”;
   Price[z]=disc;
   Z++;
System.out.println(“The cost for your choice is Rs 1500 but the discounted price is Rs”+disc); }  
Else
If(num==5)
{ disc=1250-(0.25*1250);
   Cost=cost+1250;
    Name[z]=”Trousers/shorts”;
     Price[z]=disc;
     Z++;
System.out.println(“The cost for your choice is Rs 1250 but the discounted price is Rs”+disc); }
else
System.out.println(“Please check your input”);
Break;  
Case3: System.out.println(“This is the Formal Wear section and we are very glad to announce that we have received the latest designs.”);
System.out.println(“The Formal Wear section provides you with wide varieties.”);
System.out.println(“(“ We also provide size ranging from Small(s),Medium(m),Large(l) and Extra Large(XL)”); 
 
System.out.println(“Please enter the number according to your choice.”);  
System.out.println(“Enter 1.for Formal pants 2.for Formal shirts 3.for suits 4.for Tuxedoes 5.for Coats and Blazers.”);
Num=Integer.parseInt(std.readLine());
If(num==1)
{disc=1000-(0.25*1999);
Cost=cost+disc;
Name[z]=”formal pants
Price[z]=disc;
Z++;
System.out.println(“The cost for choice is Rs 1999 but after calculating discount it is Rs”+disc); }  
Else
If(num==2)
{disc=1000-(0.25*1000);
Name[z]=formal shirts
Price[z]=disc;
Z++;
System.out.println(“The cost of your choice is Rs 1000 but after calculating discount it is Rs”+disc); }
Else
If(num==3)
{disc=3999-(0.25*3999);
Cost=cost+disc;
Name[z]=suits
Price[z]=disc;
Z++;
System.out.println(“The cost for your choice is Rs 3999 but after calculating discount it is Rs”+disc); }
Else
If(num==4)
Disc=3999-(0.25*3999);
Cost=cost+disc;
Name[z]=”tuxedos;
Price[z]=disc;
Z++;
System.out.println(“The cost for your choice is Rs 3999 but after calculating discount it is Rs”+disc); } 
Else
If(num==5)
{disc=2950-(0.25*2950);
Cost=cost+disc;
Name[z]=coats and blazers
Price[z]=disc;
Z++;
System.out.println(“The cost for your choice is Rs 2950 but after calculating discount it is Rs”+disc); }
else
System.out.println(“Please check your input”);
Break;
System.out.println(“This is the Western Wear section and we are very glad to announce that we have received the latest designs”);  
System.out.println(“The Western Wear section provides you with wide varities from the Western sides itself.”);
System.out.println((“ We also provide size ranging from Small(s),Medium(m),Large(l) and Extra Large(XL)”);   
System.out.println(“Please enter the numbers according to your choice.”);  
System.out.println(“Enter 1.for Jeans(Denim) 2.Western designed tops.”);
If(num==1)
Name[z]jeans(denim)
Price[z]=499
Z++;
System.out.println(“The cost for your choice is Rs 499”);  
Else
If(num==2)
{name[z]=”western designed tops”;
Price[z]=299;
Z++;
System.out.println(“The cost for your choice is Rs 299”);
Cost=cost+299; }
Else
System.out.println(“Please check your input”);
Break;
Case 5: System.out.println(“This is the Party Wear section !”)
System.out.println(“The Party Wear section provides you with amazing varities of choices to choose from.”);
System.out.println(“(“ We also provide size ranging from Small(s),Medium(m),Large(l) and Extra Large(XL)”);
System.out.println(“Please enter the numbers according to your choice.”);
System.out.println(“Enter 1.for Party Wear Suits 2. Funky Party Wear Outfits.”);
Num=Integer.parseInt(std.readLine());  
If(num==1)
Cost=cost+2000;
Name[z]=”party wear suits”;
Price[z]=2000;
Z++;
Else
If(num==2)
{ System.out.println (“The cost for yourchoice is Rs 2500”);
Cost=cost+2500;
Name[z]=”Funky Party Wear Outfits”;
Price[z]=2500
Z++;}
Else
System.out.println(“Please check your input”);
Break;
Default: System.out.println(“Please check your Input”);  
}
}
Public void Surprise()throws IOException
{  BufferedReader std=new BufferedReader(new InputStreamReader(System.in));
System.out.println(“Welcome to the Surprise clothing Section !!!”);  
System.out.println(“This section is solely dedicated to all those young couples out there who have decided too tie the knot.”);
System.out.println(“We try to make it special by providing a wide range of Bridal Wear for the Brides and Designer Wear for the Grooms to choose from. So please enter the number that you want !”);  
System.out.println(“All you need to do is look around and find the outfit of your size !”);
System.out.println(“Enter 1.for Gowns 2.for designers Sarees 3. For Designer Suits 4. For Designer Sherwanis.”);  
Int chow=Integer.parseInt(std.readLine());
Switch (chwo){
Case 1: System.out.println(“The cost for your purchase is Rs 5999”);
Cost=cost+5999;
Name[z]=”Gowns”;
Price[z]=5999;
Z++;
Break;
Case 2: System.out.println(“The cost for your purchase is Rs 7999;  
Cost=cost+7999;
Name[z]=”Designer Sarees”;
Price[z]=7999;
Z++;
Break;
Case 3: System.out.println(“The cost for the purchase is Rs 5999”);
Cost=cost+5999;
Name[z]=”Designer Suits”;
Price[z]=5999;
Z++;
Break;
Case 4: System.out.println(“The cost for your purchase is Rs 7999”);
Cost=cost+7999;
Name[z]=”Designer Sherwanis”;
Price[z]=7999;
Z++;
Break;
Default : System.out.println(“Please check your Input”);
}
}
Public void Kids()throws IOException
{ BufferedReader std=new BufferedReader(new InputStreamReader(System.in));
System.out.println(“Welcome to the Kids clothing section !!!”);
System.out.println(“We provide a wide range of selections of clothes for your children to choose from”);
System.out.println(“We have provided certain categories for your kids!”);
System.out.println(“The categories are for 1. 0-12 months (infants) 2. 1-6 years 3. 7-12 years 4. 8-15 years.”);
System.out.println(“Please enter the number of your choice.”);
Int chwo=Integer.parseInt(std.readLine());
Switch(chwo) {
Case1: System.out.println(“Welcome to the Infants section and we are very glad to help you choose clothes for your tiny tots!”)
System.out.println(“Please enter the gender of the baby .For example female or male.”);
String sex=std.readLine();
If(sex.equalsIgnoreCase(“female”));
System.out.println(“We are very glad to announce all that is in store for young baby girl.”);
System.out.println(“Kindly look around and choose the correct size for your darling!!”);
System.out.println(“Please enter 1.for skirts 2.for plain frocks 3. For frilled frocks!”);
Int num=Integer.parseInt(std.readLine());
If (num==1)
{ name[z]=”Skirts/t-shirts”;
   Price[z]=299;}
Z++;
System.out.println(“The cost your purchase is Rs 299”);
Cost=cost+299; }
Else
If(num==2)
{ name[z]=”Plain Frocks”;
  Price[z]=250;
  Z++;
System.out.println(“The cost for your purchase is Rs 250”);
Cost=cost+250;
Else
If(num==3)
{ name[z]=”Frilled Frocks”;
 Price[z]=325;
 Z++;
System.out.println(“The cost for your purchase is Rs 325”);
Cost=cost+325; }
Else
System.out.println(“Please check your input”);
Else
If(sex.equalsIgnoreCase(“male”))
{ System.out.println(“We are very glad to announce all that is in store for young baby boy.”);
System.out.println(“Kindly look around and choose the correct size for your darling!!”);
System.out.println(“Please enter 1.for pants/t-shirts 2.for shorts/tops !”);
Int num=Integer.parseInt(std.readLine());
If(num==1)
{ name[z]=”Pants/t-shirts”;
   Price[z]=199;
   Z++;
System.out.println(“The cost for your purchase is Rs 199”);
Cost=cost+199;
Else
If(num==2)
{ name[z]=”Shorts/tops”;
 Price[z]=225;
Z++;
System.out.println(“The cost for your purchase is Rs 225”);
Cost=cost+225;
else
System.out.println(“Please check your input”);
}
Else
System.out.println(“Please check your input”);
Break;
Case2: System.out.println(“Welcome to the 1-6 years category section and we are very glad to help you choose clothes for your little angels!”);
 System.out.println(“Please enter the gender of the kid. For example female or male.”);
 Sex=std.readLine();
If(sex.equalsIgnoreCase(“female’))
{  System.out.println(“We are very glad to announce all that is in store for young baby girl.”);
System.out.println(“Kindly look around and choose the correct
Size for your darling!!”)
System.out.println(“Please enter 1.for skirts/t-shirts/shorts 2.for plain frocks 3.for frilled frocks 4.pretty dresses 5.for dungrees and pants/Jeans 6.for ghagras!”);
Int num=Integer.parseInt(std.readLine());
Int(num==1)
{ name[z]=”Skirts/t-shirts/shorts”
  Price[z]=299;
  Z++;
System.out.println(“The cost for your purchase is Rs 299”);
Cost=cost+299;}
Else
If(num==2)
{ name[z]=”Plain Frockks”;
  Price[z]=265;
Z++;
System.out.println(“The cost for your purchase is Rs 265”);
Cost=cost+265;}
Else
If(num==3)
{ name[z]=”Filled Frocks”;
  Price[z]=325;
Z++;
System.out.println(“The cost for your purchase is Rs 325”);
Cost=cost+325;}
Else
If(num==4)
{ name[z]=”Pretty Dresses”;
 Price[z]=300;
Z++;
System.out.println(“The cost for your purchase is Rs 300”);
Cost=cost+300;}
Else
If(num==5)
{ name[z]=”Dungrees and Pants/jeans”;
Price[z]=299;
Z++;
System.out.println(“The cost for your purchase is Rs 299”);
Cost=cost+299; }
Else
If(num==6)
{ name[z]=”Ghagras”;
  Price[z]=399;
 Z++;
System.out.println(“The cost for your purchase is Rs 399”)’
Cost=cost+399;}
Else
System.out.println(“Please check your input”);
}
Else
If(sex.equalsIgnoreCase(“Male”))
{ System.out.println(“We are very glad to announce all that is in store for young baby boy.”);
System.out.println(“Kindly look around and choose the correct size for young darling!!”);
System.out.println(“Please enter 1.for pants/t-shirts 2.for shorts/tops 3.for trousers 4.for small sherwanis !”);
Int num=Integer.parseInt(std.readLine());
If(num==1)
{name[z]=”Pants/t-shirts”;
 Price[z]=299;
Z++;
System.out.println(“The cost for your purchase is Rs 299”);
Cost=cost+299;}
Else
If(num==2)
{name[z]=”Shorts/tops”;
 Price[z]=225;
 Z++;
 System.out.println(“The cost for your purchase Rs 225”);
Cost=cost+225;}
Else
If(num==3)
{name[z]=”Trousers”;
 Price[z]=399;
Z++;
System.out.println(“The cost for your purchase is Rs 399);
Cost=cost+399;
Else
If(num==4)
{name[z]=”Small Sherwanis”
Price[z]=399;
Z++;
System.out.println(“The cost for your purchase is Rs 399”);
Cost=cost+399;
}
Else
System.out.println(“Please check your input”);
}
Else
System.out.println(“Please check your input”);
Break;
Case3: System.out.println(“Welcome to the  7-12 years category section and we are very gald to help you choose cholths for your little angles.”);
System.out.println(“please enter the gender of the kid for exmple female or male”);
Sex=std.readLine();
If(sex.equalsIgnoreCase(“female”));
{ System.out.println(“we are very glad to nnounce all that is in store for your young baby girl”);
System.out.println(“ Kindly look around and choose the correct size for your darling!!”);
System.out.println(“Please enter  1. for skirts/shorts @. pretty dresses #. for dungress and pants/jeans 4. for ghagras!”);
Int num=Integer.parseInt(std.readLine());
If(num==1)
{name[z]=”Skirts/t-shirts/shorts”;
 Price[z]=399;
 Z++;
System.out.println(“The cost for your purchase is 399”);
Cost=cost+399;}
Else
If(num==2)
{ name[z]=”Pretty dresses”;
  Price[z]=295;
  Z++;
System.out.println(“The cot for your purchase is 295”);
Cost=cost+295;}
Else
If(num==3)
{name[z]=”Dungrees and Pants”;
 Price[z]=325;
 Z++;
Systtem.out.println(“The cost for yor purchase is 325”);
Cost=cost+325;}
Else
If(num==4)
{name[z]=”Ghagras”’
 Price[z]=300;
 Z++;
Systtem.out.println(“The cost for your purchase is 300”);
Cost=cost+300;}
Else
System.out.println(“Please check you input”);
}
Else
If(sex.equalsIgnoreCase(“male”))
{ Systtem.out.println(“We are glad to nnounce all that is in the store for your young baby boy”);
System.out.println(“Kindly look around and choose the correct size for our darling!!”);
System.out.println(“Please enter 1. for plant/t-shrits 2. for shorts/tops 3> for trousers 4. for small sherwanis!”);

Int num=Integer.parseInt(std.readLine());
If(num==1)
{
Name[z]=”pants/t-shirts”;
Price[z]=299;
Z++;
System.out.println(“The cost for your purchase is 299”);
Cost=cost+299;}
Else
If(num==2)
{ name[z]=”Shorts/tops”;
  Price[z]=225;
  Z++;
System.out.println(“The cost for your purchase is 225”);
Cost=cost+225;}
Else
If(num==3)
{ name[z]=”Trousers”
   Price[z]=399;
Z++;
System.out.println(“ The cost for your purchase is 399”);
Cost=cost+399;}
Else
If(num==4)
{name[z]=”Small Sherwanis”;
 Price[z]=399;
Z++;
System.out.println(“The for your purchase is 399”);
Cost=cost+399;}
Else
System.out.println(“Please check your input”);
}
Else
System.out.println(“Please check your input”);
Break;
Case4: System.out.println(“Welcome to the 8-15 years category section and we are very glad to helph you choose chloths for your little angles”);
System.out.println(“Plleas enter the gender of the kid . For example femle or male.”);
Sex=std.readLine();
If(sex.equalsIgnoreCase(“female”))
{ System.out.println(“We are very glad to announce all that I in store for your young baby girl.”);
System.out.println(“Kindly look around and choose the correct size for your darling!!”);
System.out.println(“Please enter 1. for skirts/t-shirts 2. pretty dresses 3. for daughters and pants/ 4. for ghagras!”);
Int num=Integer.parseInt(std.readLine());
If(num==1)
{name[z]=”Skirts/t-shirts/shorts”;
 Price[z]=399;
 Z++;
System.out.println(“The cost for your purchase is 399”);
Cost=cost+399;}
Else
If(num==2)
{name[z]=”Pretty Dresses”;
 Price[z]=395’
 Z++;
System.out.println(“The cost for you purchase is 395”);
Cost=cost+395;
Else
If(num==3)
{name[z]=”Dungrees and Pants/Jeans”;
Price[z]=325;
Z++;
System.out.println(“The cost for your purchase is 325”);
Cost=cost+325;}
Else
If(num==4)
{name[z]=”Ghagras”;
 Price[z]=300;
Z++;
System.out.println(“The cost for your purchase is 300”);
Cost=cost+300;}
Else
System.out.println(“Please check input”);
Else
If(sex.equalsIgnoreCase(“male”))
{ System.out.println(“We are very glad to announce all that is in store for our young baby boy.”);
System.out.println(“Kindly look around and choose the correct size for your darling!!”);
System.out.println(“Please enter 1. for pants/t-shirts 2. for shorts/tops 3. for trousers 4. for small sherwanis!”);
Int num=Integer.parseInt(st.readLine());
If(num==1)
{name[z]=”Pants/t-shirts”;
Price[z]=399;
Z++;
System.out.println(“The cost for your purchase is  399”);
Cost=cost+399;}
Else
If(num==2)
{name[z]=”Shorts/tops”
 Price[z]=325;
Z++;
System.out.println(“The cost for your purchase is 325”);
Cost=cost+325;
Else
If(num==3)
{ name[z]=”Trousers”;
  Price[z]=299;
Z++;
System.out.println(“The cost for your purchase is 299”);
Cost=cost+299;
Else
If(num==4)
{name[z]=”Small Sherwanis”;
 Price[z]=399;
Z++;
System.out.println(“The cost for your purchase is 399”);

Cost=cost+399;
}
Else
System.out.println(“Please check the input”);
}
Else
System.out.println(“Please check the input”);
Break;
Deafault: Systtem.out.println(“Please check the input”);
}
Public void Accessories()throws IOException
{ BufferedReader std=new BufferedReader(new InputStreamReader(System.in));
System.out.println(“Welcome to the Acccessories section!!!); 
System.out.println(“We provide  wide range of selection of accessories to choose from”);
System.out.println(“If you are looking for the basic necessities then you are in the right place!”);
System.out.println(“The accessories available are given below so please enter the number of your choice.”);
System.out.println(“Enter 1. for cosmetics 2. for belts 3. for baangles/bracelets 4. for chains with beautiful pendants 5. for hairbands/clips etc..6. ties”);
Int chwo=Integer.parseInt(std.readLine());
Switch(chow) {
Case 1: System.out.println(“We are glad to announce that there is 15% discount on your purchase of 2000”);
Disc=2000-(0.15*2000);
Cost=cost+disc;
Name[z]=”Cosmetics”;
Price[z]=disc;
Z++;
System.out.println(“The cost for your purchase after calculating discount is “+disc);
Break;
Case 2: System.out.println(“We are glad to announce that there is 5% discount on your purchase of 500”);
Disc=500-(0.05*500);
Cost=cost+disc;
Name[z]=”Belts”;
Price[z]=disc;
Z++;
System.out.println(“The cost for your purchase after calculating discount is “+disc);
Break;
Case 3: System.out.println(“We are glad to announce that there is 5% discount of 299”);
Disc=299(0.05*299);
Cost=cost+disc;
Name[z]=”Bangles/Brackets”;
Price[z]=disc;
Z++;
System.out.println(“The cost of your after calculating discount is “+disc);
Break;
Case 4: System.out.println(“We are glad to announce that there is 2% discount on your purchase of 250”);
Disc=250-(0.02*250);
Cost=cost+disc;
Name[z]=”Chains”;
Price[z]=disc;
Z++;
System.out.println(“The cost of your purchase after calculating discount is”+disc);
Break;
Case 5: System.out.println(“We are glad to announce that there is 2% discount on your purchase of 150”);;
Disc=150-(0.02*150);
Cost=cost+disc;
Name[z]=”Hairbands/Clips”;
Price[z]=disc;
Z++;
System.out.println(“The cos of your purchase after calculating discount is”+disc);
Break;
Case 6: System.out.println(“We are glad to announce that there is 2%discount on your purchase of 175”);
Disc=175-(0.02*175);
Cost=cost+disc;
Name[z]=”Ties”;
Price[z]=disc;
Z++;
System.out.println(“The cost of your purchase after calculating discount is “+disc);
Break;
Default: System.out.println(“Please check input”);
}
}
Public void Shoes()throws IOException
{ BufferedReader std=new BufferedReader(new InputStreamReader(System.in));
System.out.println(“Welcome to the shoes section!!!”);
System.out.println(“We provide a wide range of shoes for all those shoe lovers out there.”);
System.out.println(“All you need to do  is look around find what you like in your size!”);
System.out.println(“For more convienience we have grouped mens footwear and women footwear!”);
System.out.println(“Enter 1.Means Footwear and 2. For Women Footwear!”);
Int chow=Integer.parseInt(std.readLine());
Switch(chwo) {
Case 1: System.out.println(“Welcome to the Mens Footwear Section!!”);
System.out.println(“We hope to fulfill your need and thus provide you with a range of choices too choose from!”);
System.out.println(“Enter 1.for normal/running shoes/Converse 2. for boots 3. for sandals 4. Leather shoes.”);
Int num=Integer.parseInt(std.readLine());
If(num==1)
{name[z]=”Normal/Running shoes/converse”;
Price[z]=3000;
Z++;
System.out.println(“The cost for your purchase is 3000”);
Cost=cost+3000;
Else
If(num==2)
{name[z]=”Boots”;
Price[z]=6500;
Z++;
System.out.println(“The cost for your purchase id 6500”);
Cost=cost+6500;}
Else
If(num==3)
{name[z]=”sandals”
Price[z]=2000;
Z++;
System.out.println(“The cost for your purchase is 2000”);
Cost=cost+2000;}
Else
If(num==4)
{name[z]=”Lather shoes”;
Price[z]=4000;
Z++;
System.out.println(“The cost for  your purchase is 4000”);
Cost=cost+4000;}
Else
System.out.println(“Please check your  input”);
Break;
Case 2: System.out.println(“
System.out.println(“Welcome to the Women  Footwear Section!!”);
System.out.println(“We hope to fulfill your need and thus provide you with wide range of choices to choose from!”);
System.out.println(“Enter 1. for normal/running shoes 2. for boots 3. for sandals/flats 4. stilletos 
Num=Integer.parseInt(std.readLine());
If(num==1)
{name[z]=”Normal/Running shoes”;
Price[z]=3000;
Z++;
System.out.println(“the cost for your purchase is 3000”);
Cost=cost+3000;}
Else
If(num==2)
{name[z]=”Boots”;
Price[z]=6500;
Z++;
System.out.println(“The cost for your purchase is 6500”);
Cost=cost+6500;}
Else
If(num==3)
{name[z]=2000;
Z++;
System.out.println(“The cost for your purchase is 2000”);
Cost=cost+2000;}
Else
If(num==4)
{name[z]=”Stilletos”;
Price[z]=5400;
Z++;
System.out.println(“The cost for your purchase is 5400”);
Cost=cost+5400;}
Else
If(num==5)
{name[z]=”Mid Heels”;
Price[z]=4000;
Z++;
System.out.println(“The cost for your purchase is 4500”);
Cost=cost+4000;}
Else
If(num==6)
{name[z]=”High Heels”;
Price[z]=4500;
Z++;
System.out.println(“The cost for your purchase is 4500”);
Cost=cost+4500;}
Else
System.out.println(“Please check your input”);
Break;
Default: System.out.println(“Please check your input”);
}
}

 
by

Java online compiler

Write, Run & Share Java code online using OneCompiler's Java online compiler for free. It's one of the robust, feature-rich online compilers for Java language, running the Java LTS version 17. Getting started with the OneCompiler's Java editor is easy and fast. The editor shows sample boilerplate code when you choose language as Java and start coding.

Taking inputs (stdin)

OneCompiler's Java online editor supports stdin and users can give inputs to the programs using the STDIN textbox under the I/O tab. Using Scanner class in Java program, you can read the inputs. Following is a sample program that shows reading STDIN ( A string in this case ).

import java.util.Scanner;
class Input {
    public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
    	System.out.println("Enter your name: ");
    	String inp = input.next();
    	System.out.println("Hello, " + inp);
    }
}

Adding dependencies

OneCompiler supports Gradle for dependency management. Users can add dependencies in the build.gradle file and use them in their programs. When you add the dependencies for the first time, the first run might be a little slow as we download the dependencies, but the subsequent runs will be faster. Following sample Gradle configuration shows how to add dependencies

apply plugin:'application'
mainClassName = 'HelloWorld'

run { standardInput = System.in }
sourceSets { main { java { srcDir './' } } }

repositories {
    jcenter()
}

dependencies {
    // add dependencies here as below
    implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
}

About Java

Java is a very popular general-purpose programming language, it is class-based and object-oriented. Java was developed by James Gosling at Sun Microsystems ( later acquired by Oracle) the initial release of Java was in 1995. Java 17 is the latest long-term supported version (LTS). As of today, Java is the world's number one server programming language with a 12 million developer community, 5 million students studying worldwide and it's #1 choice for the cloud development.

Syntax help

Variables

short x = 999; 			// -32768 to 32767
int   x = 99999; 		// -2147483648 to 2147483647
long  x = 99999999999L; // -9223372036854775808 to 9223372036854775807

float x = 1.2;
double x = 99.99d;

byte x = 99; // -128 to 127
char x = 'A';
boolean x = true;

Loops

1. If Else:

When ever you want to perform a set of operations based on a condition If-Else is used.

if(conditional-expression) {
  // code
} else {
  // code
}

Example:

int i = 10;
if(i % 2 == 0) {
  System.out.println("i is even number");
} else {
  System.out.println("i is odd number");
}

2. Switch:

Switch is an alternative to If-Else-If ladder and to select one among many blocks of code.

switch(<conditional-expression>) {    
case value1:    
 // code    
 break;  // optional  
case value2:    
 // code    
 break;  // optional  
...    
    
default:     
 //code to be executed when all the above cases are not matched;    
} 

3. For:

For loop is used to iterate a set of statements based on a condition. Usually for loop is preferred when number of iterations is known in advance.

for(Initialization; Condition; Increment/decrement){  
    //code  
} 

4. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while(<condition>){  
 // code 
}  

5. Do-While:

Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.

do {
  // code 
} while (<condition>); 

Classes and Objects

Class is the blueprint of an object, which is also referred as user-defined data type with variables and functions. Object is a basic unit in OOP, and is an instance of the class.

How to create a Class:

class keyword is required to create a class.

Example:

class Mobile {
    public:    // access specifier which specifies that accessibility of class members 
    string name; // string variable (attribute)
    int price; // int variable (attribute)
};

How to create a Object:

Mobile m1 = new Mobile();

How to define methods in a class:

public class Greeting {
    static void hello() {
        System.out.println("Hello.. Happy learning!");
    }

    public static void main(String[] args) {
        hello();
    }
}

Collections

Collection is a group of objects which can be represented as a single unit. Collections are introduced to bring a unified common interface to all the objects.

Collection Framework was introduced since JDK 1.2 which is used to represent and manage Collections and it contains:

  1. Interfaces
  2. Classes
  3. Algorithms

This framework also defines map interfaces and several classes in addition to Collections.

Advantages:

  • High performance
  • Reduces developer's effort
  • Unified architecture which has common methods for all objects.
CollectionDescription
SetSet is a collection of elements which can not contain duplicate values. Set is implemented in HashSets, LinkedHashSets, TreeSet etc
ListList is a ordered collection of elements which can have duplicates. Lists are classified into ArrayList, LinkedList, Vectors
QueueFIFO approach, while instantiating Queue interface you can either choose LinkedList or PriorityQueue.
DequeDeque(Double Ended Queue) is used to add or remove elements from both the ends of the Queue(both head and tail)
MapMap contains key-values pairs which don't have any duplicates. Map is implemented in HashMap, TreeMap etc.