Tuesday, 10 October 2017

java program calculate sum of element of number


import java.util.*;
public class numSums
{
 public static void main(String args[])
{
  Scanner p= new Scanner(System.in);
   int num,sum=0;
    System.out.println("Enter any number please :");
    num=p.nextInt();
    while(num!=0)
{
       sum+=num%10;
       num/=10;
}
       System.out.println("The sum of all the elements of number is :"+sum);
}}

      

java function program take personal information


import java.util.*;
class person
{
  Scanner p = new Scanner(System.in);
  String name,address,gender;
 int age,id;
  String name()
{
   System.out.println("Enter the name of person ");
  name=p.nextLine();
  return name;
}
 int age()
{
   System.out.println("Enter the age of person ");
  age=p.nextInt();
 return age;
}
 String gender()
{
   System.out.println("Enter the gerder of person ");
  gender=p.nextLine();
 return gender;
}
int id()
{
   System.out.println("Enter the id of person ");
  id=p.nextInt();
 return id;
}
 String address()
{
   System.out.println("Enter the address of person ");
  address=p.nextLine();
 return address;
}}
public class personInformation
{
  public static void main(String args[])
{
 Scanner p = new Scanner(System.in);
 System.out.println("Enter the number of repitition :");
  int n=p.nextInt();
 person bilal = new person();
for (int i=1;i<=n;i++)
{
 
 System.out.println("Your name is  :"+bilal.name());
  System.out.println("Your age is  :"+bilal.age());
System.out.println("Your gender is  :"+bilal.gender());
System.out.println("Your id is  :"+bilal.id());
System.out.println("Your address is  :"+bilal.address());
}}} 

java calculator using functions


import java.util.*;

 class math
 {
     double num2,num1;
     double sum()
     {
          Scanner p = new Scanner(System.in);
         System.out.println("Enter the value of number 1 :");
          num1=p.nextDouble();
          System.out.println("Enter the valur of number 2 :");
          num2 = p.nextDouble();
           return num1+num2;
     }
      double subtraction()
     {
          Scanner p = new Scanner(System.in);
         System.out.println("Enter the value of number 1 :");
          num1=p.nextDouble();
          System.out.println("Enter the valur of number 2 :");
          num2 = p.nextDouble();
           return num1-num2;  
     }
    double product()
     {
          Scanner p = new Scanner(System.in);
         System.out.println("Enter the value of number 1 :");
          num1=p.nextDouble();
          System.out.println("Enter the valur of number 2 :");
          num2 = p.nextDouble();
           return num1*num2;
     }
     double division()
     {
          Scanner p = new Scanner(System.in);
         System.out.println("Enter the value of number 1 :");
          num1=p.nextDouble();
          System.out.println("Enter the valur of number 2 :");
          num2 = p.nextDouble();
           return num1+num2;
     }
             
 }
public class CalculatoreFunction
{
    public static void main(String args[])
    {   Scanner p= new Scanner(System.in);
        math as = new math(); 
      byte num;
       System.out.println("Enter 1 for addition \n Enter 2 for Subtraction \n Enter 3 for  multiplication \n Enter 4 for division :");
           num=p.nextByte();
     switch(num)
{
        
       case 1:     
  System.out.println("The result is  :"+as.sum());
      break;
     case 2:
     System.out.println("The result is :"+as.subtraction());
   break;
      case 3:
      System.out.println("The result is :"+as.product());
      break;
      case 4:
      System.out.println("The result is  :"+as.product());
 break;
       default:
        System.out.println("You enter wrong entery :");
}   
}
}

java function calculate division of number


class division
{
     double num1,num2;
    double divi()
{
     num1=90;
     num2=21;
      return num1/num2;
}}
   public class function3
  {
     public static void main(String args[])
{
       division p = new division();
     System.out.println("The product is ="+p.divi());
}}

java function calculate product


class product
{
     int num1,num2;
    int pro()
{
     num1=9;
     num2=2;
      return num1*num2;
}}
   public class function2
  {
     public static void main(String args[])
{
       product p = new product();
     System.out.println("The product is ="+p.pro());
}}

java function subtraction of two numbers


class Subtraction
{
     int num1,num2;
    int sub()
{
     num1=120;
     num2=30;
      return num1-num2;
}}
   public class function1
  {
     public static void main(String args[])
{
       Subtraction p = new Subtraction();
     System.out.println("The Subtraction is ="+p.sub());
}}

java program fin max and min number


import java.util.*;
 public class maxMin
{
 public static void main(String args[])
{
 Scanner p= new Scanner(System.in);
 System.out.println("Enter the value of a");
 int a=p.nextInt();
  System.out.println("Enter the value of b");
  int b=p.nextInt();
  if(a>b)
  System.out.println("a is greater then b");
 else if(a<b)
  System.out.println("b is greater then a");
  else
  System.out.println("Both are equal ");
}}

Java program take persnol infromation and print on screen


import java.util.*;
public class personInformation
{
  public static void main(String args[])
 {
      Scanner p = new Scanner(System.in);
       String name,add,gender;
        int id,age;
        System.out.println("Enter the name of person :");
         name=p.nextLine();
        System.out.println("Enter the gender of person :");
         gender=p.nextLine();
        System.out.println("Enter the age of person :");
         age=p.nextInt();
          System.out.println("Enter the id of person :");
         id=p.nextInt();
          p.nextLine();
         System.out.println("Enter the address of person :");
         add=p.nextLine();
          System.out.printf("Your name is  %s",name);
              System.out.printf("\nYour age is  %d",age);
              System.out.printf("\nYour id is  %d",id);
              System.out.printf("\nYour gender is  %s",gender);
              System.out.printf("\nYour address is  %s",add);
}}

using loop java calculator


mport java.util.*;
 public class loopCalculator
{
  public static void main(String args[])
{
      Scanner p = new Scanner(System.in);
      double num1,num2,res=0;
          int n;
 for(int i=1;i!=-1;i++)
{
   
  System.out.println("\nEnter 1 to calculate sum 2 for subtraction 3 for product 4 for division");
         n=p.nextInt();
      switch(n)
{
       case 1:
         System.out.println("Ente two numbers ");
            num1=p.nextDouble();
           num2=p.nextDouble();
           res=num1+num2;
         System.out.printf("The sum of two numbers is :%f",res);
       break;
      case 2:
                 System.out.println("Ente two numbers ");
            num1=p.nextDouble();
           num2=p.nextDouble();
           res=num1-num2;
         System.out.printf("The subtraction of two numbers is :%f",res);
       break;
            case 3:
                      System.out.println("Ente two numbers ");
            num1=p.nextDouble();
           num2=p.nextDouble();
           res=num1*num2;
         System.out.printf("The product of two numbers is :%f",res);
       break;
case 4:
                     System.out.println("Ente two numbers ");
            num1=p.nextDouble();
           num2=p.nextDouble();
            res=num1/num2;
         System.out.printf("The division of two numbers is :%d",res);
       break;
 default:
    System.out.println("You Enter a wrong number");
}}}}
      

java program calculate sum of element of number


import java.util.*;
public class numSums
{
 public static void main(String args[])
{
  Scanner p= new Scanner(System.in);
   int num,sum=0;
    System.out.println("Enter any number please :");
    num=p.nextInt();
    while(num!=0)
{
       sum+=num%10;
       num/=10;
}
       System.out.println("The sum of all the elements of number is :"+sum);
}}

      

Java program calculate product of three number taking from user


import java.util.*;
 public class product
{
  public static void main(String args[])
{
  Scanner p= new Scanner(System.in);
  int a,b,c,pro;
 System.out.println("Enter three number please :");
 a=p.nextInt();
 b=p.nextInt();
 c=p.nextInt();
 pro=a*b*c;
  System.out.printf("The product of three numbers is =%d",pro);
  }}

Java program print even number table


import java.util.*;
public class EvenTabble
{
 public static void main(String args[])
{
  Scanner p= new Scanner(System.in);
 int num,limit;
  System.out.println("Enter the table number please :");
  num=p.nextInt();
 System.out.println("Enter the limit of table please ");
  limit=p.nextInt();
 for(int i=1;i<=limit;i++)
{
 if(i%2==0)
 System.out.println(num+" x "+i+" = "+(num*i));
}}}

Java program print odd number table


import java.util.*;
public class oddTabble
{
 public static void main(String args[])
{
  Scanner p= new Scanner(System.in);
 int num,limit;
  System.out.println("Enter the table number please :");
  num=p.nextInt();
 System.out.println("Enter the limit of table please ");
  limit=p.nextInt();
 for(int i=1;i<=limit;i++)
{
 if(i%2==1)
 System.out.println(num+" x "+i+" = "+(num*i));
}}}

java program calculate power of number


import java.util.*;
 public class power
{
  public static void main(String args[])
{
  Scanner p = new Scanner(System.in);
  int pow,num,res=1;
   System.out.println("Enter any number please :");
   num=p.nextInt();
     System.out.println("Enter the power :");
    pow=p.nextInt();
      for(int i=1;i<=pow;i++)
    {
              res*=num;
}
  System.out.println("The result is  :"+res);
}}

Java Program Reverse A Number

Java Program Reverse A Number














import java.util.*;
 public class reverse
{
  public static void main(String args[])
{
   Scanner p=new Scanner(System.in);
    int num,rev=0;
       System.out.println("Enter any number please  :");
     num=p.nextInt();
      while(num!=0)
{
     rev=10*rev+(num%10);
      num/=10;
}   System.out.println("The sum of all the elements is :"+rev);
   }}  

java simple calculator


import java.util.*;
 public class calculator
{
  public static void main(String args[])
{
      Scanner p = new Scanner(System.in);
      int num1,num2,n;
       System.out.println("Enter 1 to calculate sum 2 for subtraction 3 for product 4 for division");
         n=p.nextInt();
      switch(n)
{
       case 1:
         System.out.println("Ente two numbers ");
            num1=p.nextInt();
           num2=p.nextInt();
         System.out.println("The sum of two numbers is :"+(num1+num2));
       break;
      case 2:
                 System.out.println("Ente two numbers ");
            num1=p.nextInt();
           num2=p.nextInt();
         System.out.println("The subtraction of two numbers is :"+(num1-num2));
       break;
            case 3:
                      System.out.println("Ente two numbers ");
            num1=p.nextInt();
           num2=p.nextInt();
         System.out.println("The product of two numbers is :"+(num1*num2));
       break;
case 4:
                     System.out.println("Ente two numbers ");
            num1=p.nextInt();
           num2=p.nextInt();
         System.out.println("The division of two numbers is :"+(num1/num2));
       break;
 default:
    System.out.println("You Enter a wrong number");
}}}
      

java program calculate Sum of odd numbers


import java.util.*;
 public class  oddSum
{
public static void main(String args[])
{
    Scanner p= new Scanner(System.in);
  System.out.println("Enter the limit of odd addition numbers :");
   int sum=0,limit=p.nextInt();
  for(int i=0;i<=limit ;i++)
   {
         if(i%2==1)
         sum+=i;
}
     System.out.println("The sum of odd numbers is ="+sum);
}}

java program tell number is positive or negative


write a program that calculate that tell number is positive or negative
public class posiNeg
{
  public static void main(String args[])
{
   int num ;
if(num>0)
System.out.println("Number is positive "+num);
else if(num<0)
System.out.println("Number is ngitive "+num);
else
System.out.println("Number is Zero ");
}}

java Fibonacci series program

java Fibonacci  series program

In fibonacci siriis, nixt numbir is thi sum of privious two numbirs for ixampli 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 itc. Thi first two numbirs of fibonacci siriis ari 0 and 1.

Thiri ari two ways to writi thi fibonacci siriis program in java:Fibonacci Siriis without using ricursionFibonacci Siriis using ricursion

write a program that print the Fibonacci  numbers

         import java.util.*;
public class fibonacciNumber
{
   public static void main(String args[])
{
  Scanner p=new Scanner(System.in);
  int num1=0,num2=1,sum=0,rep;
   System.out.println("Enter the number of repition do you want to preform");
    rep=p.nextInt();
   System.out.println(num1);
    System.out.println(num2);
  for(int i=2;i<=rep;i++)
{        sum=num1+num2;
       System.out.println(sum);
         num1=num2;
         num2=sum;
}
}
}
  

java management system for hotel

java  management system for hotel


Hotil managimint systim projict fiaturis and function riquirimint. Shari java Projict idias and topics with us. grati and many java projict idias and topics. hiri somi java projict idias for risiarch papir. hiri largi colliction of java projict with sourci codi and databasi. wi many idia to divilopmint application liki mobili application,disktop softwari application,wib application divilopmint. you can find mori projict topics and idias on java. divilopmint idias on Hotil managimint systim. many projict availabli to download with java sourci codi and databasi. frii download Hotil managimint systim projict synopsis availabli.

//Written by Muhammad Ashfaq maher

import java.util.*;
 public class hotelManagementSystem
{
 public static void main(String args[])
{
  Scanner input = new Scanner(System.in); // Taking  integer form user
  Scanner Input = new Scanner(System.in); // Taking string  form user
 Scanner inpuT =new Scanner(System.in);   // Taking character from user
   int roomKey[] = {001,031,213,322,433,531,116,711,811,91,102,121,12,413,14,115,136,127,148,119,230,211,223,323,224,225,236,272,282,291};
  String  Room[] = {"Room*** no 01 ","Room*** no 02 ","Room*** no 03 ","Room*** no 04","Room*** no 05","Room*** no 06","Room*** no 07","Room*** no 08","Room*** no 09",
    "Room*** no 10","Room** no 01","Room** no 02","Room** no 03","Room** no 04","Room** no 05","Room** no 06","Room** no 07","Room** no 08","Room** no 09",
   "Room** no 10","Room* no 01","Room* no 02","Room* no 03","Room* no 04","Room* no 05","Room* no 06","Room* no 07","Room* no 08","Room* no 09","Room* no 10"};
  String Food[] = {"chicken karrai","Beaf karrai","Mutan karrai","chicken biryani","Nan channay","halwa pori","Dal chawal","kabli palauo","chines Rice","Makruni","tikka karrai",};
   int foodPrice[] = {200,230,370,120,130,140,80,130,110,220,300};
   String  name[]=new String[30]; 
   String  gender[]=new String[30];
  int[] id=new int[30];
  int totalIncome=0,totalDuesVehical=0,rent,i=0,j=10,k=20,l=0,pp=0,kk=-1,uo=0;
  for(int s=0;s!=-1;s++) {
  System.out.println("\n//////////     WELCOME TO       /////////////");
  System.out.println("////////  Hotel Managment System ///////////");
  System.out.println("                Menu       \n                  ");
   System.out.println("Enter 1 for transport service \n Enter 2 for reservation of RooM \n Enter 3 for clients information \n Enter 4 for leaving custmer \n Enter 5 for Food services \n Enter 6 to check total income  ");
    System.out.println("Enter 7 to check for salaries for hotel  staff");
    char choice = inpuT.next().charAt(0);
   switch(choice) {
    case '1':
     System.out.println("Enter 1 for A.C car service \n Enter 2 for non A.C car Service \n Enter 3 for rishka service ");
      char cHoice=inpuT.next().charAt(0);
      switch(cHoice)
{
       case '1':
       System.out.println("Charges are 100/KM ");
       System.out.println("Enter the distance in kilo meter :");
       int distance = input.nextInt();
        totalDuesVehical=(30*distance);
        totalIncome+=(100*distance);
        totalIncome-=totalDuesVehical;
       break;
      case '2':
        System.out.println("Charges are 70/KM ");
       System.out.println("Enter the distance is Kilo meter :");
        int Distance=input.nextInt();
          totalDuesVehical=27*Distance;
        totalIncome+=(70*Distance);
        totalIncome-=totalDuesVehical;
        break;
       case '3':
      System.out.println("Charges are 20/Km");
       System.out.println("Enter the distance in kilo meter :");
      int distancE= input.nextInt();
       totalDuesVehical=10*distancE;
       totalIncome+=(20*distancE);
       totalIncome-=totalDuesVehical;
       break;
   default:
    System.out.println("Invaild Entry ");
}
break;
    
  case '2':  
  System.out.println("Enter A to reserve room for classA custmers\n \n Enter B to reserve room for classB custmers\n \n Enter C to reserve room for classC custmers ");
  char ch=inpuT.next().charAt(0);
switch(ch)
{ 
  case 'A':
          if(l<10)
{
   if(i<30)
{
    for(int ip=0;ip<=kk;i++)
     l=kk;
  System.out.println("Enter the name of custmer ");
       name[l]=Input.nextLine(); uo++;
    System.out.println("Enter the gender ");
       gender[l]=Input.nextLine();
    System.out.println("Enter the ID of custmer ");
    id[l]=input.nextInt();
      System.out.println("Enter the rent for classA*** room  ");
       rent=input.nextInt();
   totalIncome+=rent;
   System.out.println(Room[l]+" is reserved for "+name[l]+"  Your Room key number "+roomKey[l]); ++i; l++;  }
else
  { System.out.println(" Rooms are not available for you : "); }}
 else System.out.println("No More classA*** Rooms are available for you");
     break;
 case 'B':
    if(j<20)
{
   if(i<30)
{
  System.out.println("Enter the name of custmer ");
       name[j]=Input.nextLine();
    System.out.println("Enter the gender ");
       gender[j]=Input.nextLine();
    System.out.println("Enter the ID of custmer ");
    id[j]=input.nextInt();
      System.out.println("Enter the rent for classB** room  ");
       rent=input.nextInt();
   totalIncome+=rent;
   System.out.println(Room[j]+" is reserved for "+name[j]+" Your Room key number  "+roomKey[j]); ++i; j++;}
else
  { System.out.println(" Rooms are not available in this time "); }}
else System.out.println("No more classB** Rooms are available ");

 break;
 case 'C':
if(k<30)
 {
  if(i<30)
{
  System.out.println("Enter the name of custmer ");
       name[k]=Input.nextLine();
    System.out.println("Enter the gender ");
       gender[k]=Input.nextLine();
    System.out.println("Enter the ID of custmer ");
    id[k]=input.nextInt();
      System.out.println("Enter the rent for classC* room  ");
       rent=input.nextInt();
   totalIncome+=rent;
   System.out.println(Room[k]+" is reserved for "+name[k]+" Your Your Room key number  :"+roomKey[k]); ++i; ++k; }
else
  { System.out.println(" Rooms are not available in this time "); }}
else System.out.println("No more classC* Rooms are available :");
  break;
default:
 System.out.println("Invaild Entrey");
} break;
 case '3':
        System.out.println("Enter 1 to take information about classA Room*** service\n Enter 2 to take information about classB Room** service \n Enter 3 to take information about classB Room* service ");
   char ChOice = inpuT.next().charAt(0);
       switch(ChOice)
{   case '1':
      int w=0;
    if((l==0)&&(pp==0))
      { System.out.println(" No A class custmer are available :");}
    else if((pp>w)||(l>w))
{     for(;(w<pp)||(w<l);w++)
     {
       System.out.println(name[w]+" gender "+gender[w]+" and ID is"+id[w]);
      }}
      break;
     case '2':
       int e=10;
       if(j==10)
     {
           System.out.println(" No B class custmer are available :");}
      else if(j>e) {
      for(;e<j;e++)
     {
       System.out.println(name[e]+" gender "+gender[e]+" and ID is"+id[e]);
      }}
        break;
     case '3':
        int r=20;
      if(k==20)
{    System.out.println(" No C class custmer are available :");}
       else if(k>r)
{
        for(;r<k;r++)
     {
       System.out.println(name[r]+"\n gender "+gender[r]+" /nID is"+id[r]);
      }}
     break;
  default :
  System.out.println("Invaild Entery ");
                                        }
 break;
  case '4':
  System.out.println("Enter 1 when class A custmer are leaving \n Enter 2 when class B custmer are leaving \n Enter 3 when class C custmer are leavig ");  
 char choicE = inpuT.next().charAt(0);
   switch(choicE)
{
   case '1':
   System.out.println("Enter the room number who leave :0 to 9");    
   int n=input.nextInt();
    pp=l;
    kk=n;
    if(n<l) {
    System.out.println(name[n]+"\n gender "+gender[n]+" \nID is"+id[n]+"\nAre leave from Hotel ");
       name[n]=name[11];
       gender[n]=gender[11];
       id[n]=id[11];
     
     }
else System.out.println("This Room*** is already empty ");
  break;
 case '2':
   System.out.println("Enter the room number who leave :10 to 19");    
   int y= input.nextInt();
    if(y<j) {
    System.out.println(name[y]+"\n gender "+gender[y]+" \nID is"+id[y]+"\nAre leave from Hotel ");
      j=++y;
      j--; }
else System.out.println("This Room** is already empty ");
  break;
case '3':
   System.out.println("Enter the room number who leave :20 to 29");    
   int u= input.nextInt();
    if(u<k) {
    System.out.println(name[u]+"\n gender "+gender[u]+" \nID is"+id[u]+"\nAre leave from Hotel ");
       k=++u;
      k--; }
else System.out.println("This Room* is already empty ");
  break;
  default:
  System.out.println("You Enter a wrong number ");
       
}
break;
case '5':
System.out.println("\n//////////////Menu///////////////////// \n");
 System.out.println("//////////////These Foods are available//////////\n");
 for(int q=0;q<11;q++)
  {
     System.out.println(Food[q]+"\t\t"+foodPrice[q]);

 }
          System.out.println("please Enter the number do you want to eat :");
           int num = input.nextInt();
           System.out.println("Thank you for bought  "+Food[num-1]);
           totalIncome+=foodPrice[num-1];
 break;
     case '6':
         System.out.println("The total income is :"+(totalIncome));
       break;
case '7':
         System.out.println();
 break;
    default:
    System.out.println("Damag theek hay nazar nahi aa raha :");
}}
    }}
  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
import java.util.*;
 public class hotelManagementSystem
{
 public static void main(String args[])
{
  Scanner input = new Scanner(System.in); // Taking  integer form user
  Scanner Input = new Scanner(System.in); // Taking string  form user
 Scanner inpuT =new Scanner(System.in);   // Taking character from use
    String hotelStaff[]={"Omais","Imran","Moodi","Bush","Obama","Trump","Zardari","Shakh ","Nawaz ","Shahbaz","Imran","Jakey","iftikhar"};
     String Ranks[]={"Manager","Manager","Waiter","Waiter","Waiter","Waiter","Saweper","Saweper","Cock","Cock","Gardner","Security","Security"};
      int salaryStaff[]={40000,40000,13000,12000,13000,12000,10000,10000,14000,14000,9000,17000,14000};

   int roomKey[] = {901,031,213,322,433,531,116,711,811,91,102,121,12,413,14,115,136,127,148,119,230,211,223,323,224,225,236,272,282,291};
  String  Room[] = {"Room*** no 01 ","Room*** no 02 ","Room*** no 03 ","Room*** no 04","Room*** no 05","Room*** no 06","Room*** no 07","Room*** no 08","Room*** no 09",
    "Room*** no 10","Room** no 01","Room** no 02","Room** no 03","Room** no 04","Room** no 05","Room** no 06","Room** no 07","Room** no 08","Room** no 09",
   "Room** no 10","Room* no 01","Room* no 02","Room* no 03","Room* no 04","Room* no 05","Room* no 06","Room* no 07","Room* no 08","Room* no 09","Room* no 10"};
  String Food[] = {"chicken karrai","Beaf karrai","Mutan karrai","chicken biryani","Nan channay","halwa pori","Dal chawal","kabli palauo","chines Rice","Makruni","tikka karrai",};
   int foodPrice[] = {200,230,370,120,130,140,80,130,110,220,300};
   String  name[]=new String[30]; 
   String  gender[]=new String[30];
  int[] id=new int[30];
  int totalIncome=0,rent,i=0,j=10,k=20,l=0,pp=0,kk=-1,uo=0,day=1;     //These are variable that control the flow of program
  for(int s=0;s!=-1;s++) {
  System.out.println("\n//////////     WELCOME TO       /////////////");
  System.out.println("////////  Hotel Managment System ///////////");
  System.out.println("                Menu       \n                  ");
   System.out.println(" Enter 1 for transport service \n Enter 2 for reservation of RooM \n Enter 3 for clients information \n Enter 4 for leaving custmer \n Enter 5 for Food services \n Enter 6 to check total income  ");
    System.out.println("Enter 7 to check for salaries for hotel  staff\n Enter 8 for dues of hotel :");
    char choice = inpuT.next().charAt(0);
   switch(choice) {
    case '1':
     System.out.println("Enter 1 for A.C car service \n Enter 2 for non A.C car Service \n Enter 3 for rishka service ");
      char cHoice=inpuT.next().charAt(0);
      switch(cHoice)
{
    
       case '1':
       System.out.println("Charges are 100Rs/KM ");
       System.out.println("Enter the distance in kilo meter :");
       int distance = input.nextInt();
        int debit=(30*distance);
        totalIncome+=(100*distance);
        totalIncome-=debit;
     System.out.println("Your rent is = "+(100*distance));
    System.out.println("The debit on this service is  ="+debit);
       break;
      case '2':
        System.out.println("Charges are 70Rs/KM ");
       System.out.println("Enter the distance is Kilo meter :");
        int Distance=input.nextInt();
          int debiT=27*Distance;
        totalIncome+=(70*Distance);
        totalIncome-=debiT;
      System.out.println("Your rent is = "+(70*Distance));
   System.out.println("The debit on this service is  ="+debiT);
      break;
       case '3':
      System.out.println("Charges are 20Rs/Km");
       System.out.println("Enter the distance in kilo meter :");
      int distancE= input.nextInt();
       int Debit=10*distancE;
       totalIncome+=(20*distancE);
       totalIncome-=Debit;
  System.out.println("Your rent is = "+(20*distancE));
    System.out.println("The debit on this service is  ="+Debit);
      break;
   default:
    System.out.println("Invaild Entry ");
}
break;
    
  case '2':  
  System.out.println("Enter A to reserve room for classA custmers\n \n Enter B to reserve room for classB custmers\n \n Enter C to reserve room for classC custmers ");
  char ch=inpuT.next().charAt(0);
switch(ch)
{ 
  case 'A':
          if(l<10)
{
   if(i<30)
{
    for(int ip=0;ip<=kk;i++)
     l=kk;
  System.out.println("Enter the name of custmer ");
       name[l]=Input.nextLine(); uo++;
    System.out.println("Enter the gender ");
       gender[l]=Input.nextLine();
    System.out.println("Enter the ID of custmer ");
    id[l]=input.nextInt();
      System.out.println("Enter the rent for classA*** room  ");
       rent=input.nextInt();
   totalIncome+=rent;
   System.out.println(Room[l]+" is reserved for "+name[l]+"  Your Room key number "+roomKey[l]);
      System.out.println("Please give Rent "+rent+"Rs then you Enter in this room");  ++i; l++;  }
else
  { System.out.println(" Rooms are not available for you : "); }}
 else System.out.println("No More classA*** Rooms are available for you");
     break;
 case 'B':
    if(j<20)
{
   if(i<30)
{
  System.out.println("Enter the name of custmer ");
       name[j]=Input.nextLine();
    System.out.println("Enter the gender ");
       gender[j]=Input.nextLine();
    System.out.println("Enter the ID of custmer ");
    id[j]=input.nextInt();
      System.out.println("Enter the rent for classB** room  ");
       rent=input.nextInt();
   totalIncome+=rent;
   System.out.println(Room[j]+" is reserved for "+name[j]+" Your Room key number  "+roomKey[j]);
      System.out.println("Please give Rent "+rent+"Rs then you Enter in this room");  ++i; j++;}
else
  { System.out.println(" Rooms are not available in this time "); }}
else System.out.println("No more classB** Rooms are available ");

 break;
 case 'C':
if(k<30)
 {
  if(i<30)
{
  System.out.println("Enter the name of custmer ");
       name[k]=Input.nextLine();
    System.out.println("Enter the gender ");
       gender[k]=Input.nextLine();
    System.out.println("Enter the ID of custmer ");
    id[k]=input.nextInt();
      System.out.println("Enter the rent for classC* room  ");
       rent=input.nextInt();
   totalIncome+=rent;
   System.out.println(Room[k]+" is reserved for "+name[k]+" Your Your Room key number  :"+roomKey[k]);
    System.out.println("Please give Rent "+rent+"Rs then you Enter in this room");  ++i; ++k; }
else
  { System.out.println(" Rooms are not available in this time "); }}
else System.out.println("No more classC* Rooms are available :");
  break;
default:
 System.out.println("Invaild Entrey");
} break;
 case '3':
        System.out.println("Enter 1 to take information about classA Room*** service\n Enter 2 to take information about classB Room** service \n Enter 3 to take information about classB Room* service ");
   char ChOice = inpuT.next().charAt(0);
       switch(ChOice)
{   case '1':
      int w=0;
    if((l==0)&&(pp==0))
      { System.out.println(" No A class custmer are available :");}
    else if((pp>w)||(l>w))
{     for(;(w<pp)||(w<l);w++)
     {
       System.out.println(name[w]+" gender "+gender[w]+" and ID is"+id[w]);
      }}
      break;
     case '2':
       int e=10;
       if(j==10)
     {
           System.out.println(" No B class custmer are available :");}
      else if(j>e) {
      for(;e<j;e++)
     {
       System.out.println(name[e]+" gender "+gender[e]+" and ID is"+id[e]);
      }}
        break;
     case '3':
        int r=20;
      if(k==20)
{    System.out.println(" No C class custmer are available :");}
       else if(k>r)
{
        for(;r<k;r++)
     {
       System.out.println(name[r]+"\n gender "+gender[r]+" /nID is"+id[r]);
      }}
     break;
  default :
  System.out.println("Invaild Entery ");
                                        }
 break;
  case '4':
  System.out.println("Enter 1 when class A custmer are leaving \n Enter 2 when class B custmer are leaving \n Enter 3 when class C custmer are leavig ");  
 char choicE = inpuT.next().charAt(0);
   switch(choicE)
{
   case '1':
   System.out.println("Enter the room number who leave :0 to 9");    
   int n=input.nextInt();
    if(n<l) {
    System.out.println("Name"+name[n]+"\n gender "+gender[n]+" \nID is"+id[n]+"\nAre leave from Hotel ");
      l=++n;
      l--;
     
     }
else System.out.println("This Room*** is already empty ");
  break;
 case '2':
   System.out.println("Enter the room number who leave :10 to 19");    
   int y= input.nextInt();
    if(y<j) {
    System.out.println(name[y]+"\n gender "+gender[y]+" \nID is"+id[y]+"\nAre leave from Hotel ");
      j=++y;
      j--; }
else System.out.println("This Room** is already empty ");
  break;
case '3':
   System.out.println("Enter the room number who leave :20 to 29");    
   int u= input.nextInt();
    if(u<k) {
    System.out.println(name[u]+"\n gender "+gender[u]+" \nID is"+id[u]+"\nAre leave from Hotel ");
       k=++u;
      k--; }
else System.out.println("This Room* is already empty ");
  break;
  default:
  System.out.println("You Enter a wrong number ");
       
}
break;
case '5':
System.out.println("\n//////////////Menu///////////////////// \n");
 System.out.println("//////////////These Foods are available//////////\n");
 for(int q=0;q<11;q++)
  {
     System.out.println(Food[q]+"\t\t"+foodPrice[q]);

 }
          System.out.println("please Enter the number do you want to eat :");
           int num = input.nextInt();
           System.out.println("Thank you for bought  "+Food[num-1]);
           totalIncome+=foodPrice[num-1];
 break;
     case '6':
         System.out.println("The total income is :"+(totalIncome));
       break;
case '7':
                       System.out.println("////////////Welcome To/////////////");
                       System.out.println("//////////////Salary Menu//////////");
        System.out.println("Enter 1 to check the salary of all  the staff\nEnter 2 When hotel staff recieve salary:");
         char CHOicE=inpuT.next().charAt(0);
          switch(CHOicE)
          {
        case '1':
        System.out.println("Names\t\tRanks\t\tSalary");
         for(int as=0;as<13;as++)
        { System.out.println(hotelStaff[as]+"\t\t"+Ranks[as]+"\t\t"+salaryStaff[as]);}
         break;
    case '2':
          System.out.println("If you want to give salaries Enter 1 or when mounth is complete");
          int number=input.nextInt();
          if(number==1)
      {      System.out.println("Names\t\tRanks\t\tSalary");
        
             
               for(int tu=0;tu<13;tu++)
               {
         System.out.println(hotelStaff[tu]+"\t\t"+Ranks[tu]+"\t\t"+salaryStaff[tu]+"\t Reiceve salary");
                               totalIncome-=salaryStaff[tu];
          }}
          else
            System.out.println("Salary is not found for you because mounth does not complete :");
               break;
              default:
          System.out.println("Wrong Entery");

}
 break;
          case '8':
            System.out.println("Enter 1 for electric bill\nEnter 2 for gass bill \nEnter 3 for water bill");
           char bill=inpuT.next().charAt(0);
           switch(bill) {
            case '1':
             System.out.println("Enter the bill of this mounth:");
              int Bill=input.nextInt();
             totalIncome-=Bill;
              System.out.println(Bill+"is cut from your total income \n Now your total income is ="+totalIncome);
           break;
           case '2':
             System.out.println("Enter the bill of this mounth:");
              int BIll=input.nextInt();
             totalIncome-=BIll;
              System.out.println(BIll+"is cut from your total income \n Now your total income is ="+totalIncome);
            break;
             case '3':
             System.out.println("Enter the bill of this mounth:");
              int BilL=input.nextInt();
             totalIncome-=BilL;
              System.out.println(BilL+"is cut from your total income \n Now your total income is ="+totalIncome);
             break;   
       default:
            System.out.println("Enter right number please :");
}          break;
    default:
    System.out.println("Damag theek hay nazar nahi aa raha :");
}}
    }}