JAVA PROGRAM FOR CALCULATION OF PROJECT BILL

A Simple Java Program to calculate the total bill values for different types of associates in a project.

importjava.io.BufferedReader;
importjava.io.IOException;
importjava.io.InputStreamReader;

public class PickBillRate {

publicPickBillRate(){};

public static void main (String[] args)

    {

System.out.println(“Hello”);
      String username = null;
      String userExit =”N”;

try{
while(userExit.equalsIgnoreCase(“N”))
             {

BufferedReader reader= new BufferedReader(new InputStreamReader(System.in));
System.out.print(“Please enter use name:”);
 username = reader.readLine();

System.out.println(“Welcome :” +username);
System.out.print(“Please enter Dev for Programmer, AOff for Offshore Analyst, AOn for Onsite Analyst:”);

               String userChoice =null;
userChoice = reader.readLine();
if(userChoice.equalsIgnoreCase(“Dev”))
                {
intDevrate = 1000;
System.out.print(“Please enter number of Programmers:”);
int Doff = Integer.parseInt(reader.readLine());
int Val = Devrate*Doff;
System.out.print(“The Programmer Rate is:” + Val);

                }
else if (userChoice.equalsIgnoreCase(“AOff”))
                {
intBoffrate = 1500;
System.out.print(“Please enter number of Offshore Analysts:”);
intBoff = Integer.parseInt(reader.readLine());
int Val = Boffrate*Boff;
System.out.print(“The Analyst Rate for Offshore is:”+ Val);
                }
else if (userChoice.equalsIgnoreCase(“AOn”))
                {
intBonrate = 4500;
System.out.print(“Please enter number of Onsite Analysts:”);
int Bon  = Integer.parseInt(reader.readLine());
int Val = Bonrate*Bon;
System.out.print(“The Analyst Rate for Onsite is :”+ Val);
                }
else
                {
System.out.print(“Error!!!”);
                }
System.out.print(” Do you want to continue Y/N : “);

                    String yesNo  =reader.readLine();
if (yesNo.equalsIgnoreCase(“N”))
                    {
userExit = “Y”;
                    }
else
                    {
userExit = “N”;
                    }
                }
         } catch (IOException e)

         {
e.printStackTrace();
         }
    }

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s