import java.util.*;
public class BeautyParlour
{
Scanner sc= new Scanner(System.in);
int idd=4;
int id2=5;
int b_cost, c_b_sr, c_b_cost, out, again, d, psr, m, pid, cid, x, cuid;
String b_type ,b_b_type ,c_b_type ,c_b_b_type ,ss ,a ,b ;
char b_scp;
double bill;
int b_sr[];
int i;
public static void main()
{
int ch;
BeautyParlour ob= new BeautyParlour();
Scanner sc= new Scanner(System.in);
do
{
System.out.println(“f”);
System.out.println();
System.out.println();
System.out.println();
System.out.println();
System.out.println(“tttt —-BEAUTY PARLOUR—-“);
System.out.println(“tttt 1. MENU CARD”);
System.out.println();
System.out.println(“tttt 2. ADD”);
System.out.println();
System.out.println(“tttt 3. REMOVE”);
System.out.println();
System.out.println(“tttt 4. MODIFY”);
System.out.println();
System.out.println(“tttt 5. BILL”);
System.out.println();
System.out.println(“tttt 6. GIFT VOUCHER”);
System.out.println();
System.out.println(“tttt 7. EXIT”);
System.out.println();
System.out.println(“tttt 8. FACILITY”);
System.out.println();
System.out.println(“tttt ENTER YOUR CHOICE —> “);
ch=sc.nextInt();
switch(ch)
{
case 1:
ob.menu();
break;
case 2:
ob.add();
break;
case 3:
ob.remove();
break;
case 4:
ob.modify();
break;
case 5:
ob.register();
break;
case 6:
ob.bill();
break;
case 7:
ob.gift();
break;
case 8:
ob.out=1;
ob.again=0;
break;
case 9:
ob.facility();
break;
default:
System.out.println(“Invalid choice. “);
}
if(ob.out==0)
{
System.out.println(“Enter 1 to remain in the MAIN MENU.”);
ob.again=sc.nextInt();
}
}
while(ob.again==1);
System.out.println();
System.out.println(” Thank You for visiting! Hope to see you again! π “);
}
void facility()
{
System.out.println(“f”);
int conti3;
int choice3;
menu();
if(id2>5)
{
System.out.println(” Your customer ID is “+(id2-1));
do
{
boolean flag= false;
System.out.println(” Enter the choice of the facility you want: “);
choice3 = sc.nextInt();
for( int i=0; i<b_sr.length;i++)
{
flag= true;
c_b_sr[idd]=id2-1;
c_b_type[idd]=b_type[i];
c_b_b_type[idd]=b_b_type[i];
c_b_cost[idd]=b_cost[i];
idd++;
break;
}
if(flag==false)
{
System.out.println(” **** Wrong facility ID entered **** “);
}
System.out.println(” Press 1 if you want to purchase again “);
conti3=sc.nextInt();
}
while(conti3==1);
}
else
{
System.out.println(” You need to register first!”);
}
}
void menu()
{
int i;
System.out.println(“f”);
System.out.println(“tttt MAIN MENU “);
System.out.println();
System.out.println();
System.out.println();
System.out.println(“tt————————————————————“);
System.out.println(“tt|srno.t|typet|catt|cost|”);
for(i=0;i<b_sr.length;i++)
{
if(b_sr[i]!=0 && b_scp[i]=’n’)
{
System.out.println(“tt|”+ b_sr[i] +”t|”+ b_type[i] +”t|”+ b_b_type[i] +”t|”);
System.out.println(“tt——————————————————-“);
}
}
}
void add()
{
menu();
int i;
boolean flag = false;
for(i=0;i<b_sr.length;i++)
{
if(b_sr[i]== 0)
{
flag=true;
break;
}
}
if(flag==true)
{
String ss= sc.nextLine();
b_sr[i]=i+1;
System.out.println(“Your next product ID is: “+(i+1));
System.out.println();
System.out.println(“Enter the type: “);
String a=sc.nextLine();
b_type[i]=a;
System.out.println(“Enter the Category: “);
String b= sc.nextLine();
b_b_type[i]=b;
System.out.println(“Enter the cost: “);
int d=sc.nextInt();
b_cost[i]=d;
}
}
void remove()
{
int again=0;
do
{
System.out.println(“f”);
menu();
System.out.println(“Enter Product No.: “);
int psr=sc.nextInt();
boolean flag= false;
int i;
for( i=0; i<b_sr.length;i++)
{
if(b_sr[i]==psr)
{
flag = true;
b_scp[i]=’n’;
loading();
System.out.println(“The product has been removed. “);
break;
}
}
if(flag==false)
{
System.out.println(“**** Invalid Product Number ****”);
}
System.out.println(“Press 1 if you want to remain in scrap”);
again=sc.nextInt();
}
while(again==1);
}
void loading()
{
System.out.println(“LOADING”);
int m=1;
long i;
for(i=1;i<=100000000;i++)
{
if (m==100000000)
{
m=1;
System.out.println(“.”);
}
m++;
}
System.out.println();
}
void modify()
{
menu();
System.out.println();
System.out.println(“Enter the product ID: “);
int pid= sc.nextInt();
boolean flag = false;
int i;
for(i=0; b_sr.length;i++)
{
if(pid==b_sr[i] && b_scp[i]==’n’)
{
flag=true;
System.out.println(“The current price is: “+b_cost[i]);
System.out.println();
System.out.println(“Enter the price to be modified: “);
b_cost[i]=sc.nextInt();
System.out.println();
System.out.println(“The new price has been updated successfully. “);
break;
}
}
if(flag==false)
{
System.out.println(“**** Invalid Product ID ****”);
}
}
void register()
{
System.out.println(“Your customer ID is: “+id2);
id2++;
}
void bill()
{
int cid;
double dis=0.0;
int i;
double bill=0.0;
int x=0;
System.out.println(“Enter Customer ID: “);
cid=sc.nextInt();
boolean bflag=true;
for(i=0;i<c_b_sr.length;i++)
{
if(c_b_sr[i]==cid)
{
bflag = false;
if(x==0)
{
System.out.println(“Customer No.: “+c_b_sr[i]+”n”);
x++;
}
System.out.println();
System.out.println();
System.out.println(“tt|srno.t|typet|cat|t|cost|”);
System.out.println(“tt”+c_b_sr[i]+”t”+c_b_type[i]+”t”+c_b_b_type[i]);
bill= bill+ c_b_cost[i];
}
}
System.out.println(” YOUR FINAL BILL AMOUNT IS : “+bill);
System.out.println();
System.out.println();
if(bflag)
{
System.out.println(“**** Invalid Customer ID ****”);
}
else
{
if(bill>=2000)
{
System.out.println(“You are eligible for a 5% discount. “);
bill=bill-bill*0.05;
}
else if (bill>= 2001 && bill <= 3500)
{
System.out.println(” You are eligible for a 10% discount. “);
bill= bill-bill*0.10;
}
else if (bill >=3501)
{
System.out.println(“You are eligible for a 15% discount. “);
bill=bill-bill*0.15;
}
}
}
void gift()
{
int i;
System.out.println(“Enter Customer ID: “);
int cuid=sc.nextInt();
for(i=0; i<c_b_sr.length;i++)
{
if(c_b_sr[i]==cuid)
{
if(c_b_cost[i]>=0 && c_b_cost[i]<500)
{
System.out.println(” Sorry, You are not eligible for a gift voucher”);
}
else if(c_b_cost[i]>=500 && c_b_cost[i]<1000)
{
System.out.println(” You are eligible for gift voucher of Rs. 500 (Validity – 2 months).”);
}
else if(c_b_cost[i]>=1000 && c_b_cost[i]<2000)
{
System.out.println(” You are eligible for gift voucher of Rs. 300 (Validity – 2 months).”);
}
else
{
System.out.println(” You are eligible for gift voucher of Rs. 100 (Validity – 2 months).”);
}
}
}
}
}