Tuesday, 11 September 2012

In a company, worker efficiency is determined on the basis of the time required for a worker to complete a particular job. If the time taken by the worker is between 2 – 3 hours, then the worker is said to be highly efficient. If the time required by the worker is between 3 – 4 hours, then the worker is ordered to improve speed. If the time taken is between 4 – 5 hours, the worker is given training to improve his speed, and if the time taken by the worker is more than 5 hours, then the worker has to leave the company. If the time taken by the worker is input through the keyboard, find the efficiency of the worker.


main()
{
 float time;
 printf("Enter the time taken by the worker in hours (hh.mm) :- ");
 scanf("%f",&time);
 if(time>=2.00 && time<=3.00)
 printf("This worker is highly efficient.");
 else if(time>3.00 && time<=4.00)
 printf("This worker is ordered to improve speed.");
 else if(time>4.00 && time<=5.00)
 printf("This worker is given training to improve his speed. ");
 else
 printf("This worker has to leave the company.");
}

output:-

5 comments:

  1. public class Worker {

    public static void main(String[] args)
    {

    int hour = 3;
    int takenhour = hour;

    if(hour>=2 &&hour<=3)
    {
    System.out.println("This worker is highly Efficient,"+" Your taken Hour is: "+takenhour+"hr");
    }

    else if(hour>3 &&hour<=4)
    {
    System.out.println("This worker is ordered to improve Speed,"+" Your taken Hour is: "+takenhour+"hr");
    }

    else if(hour>4 &&hour<=5)
    {
    System.out.println("This worker is given training to improve Speed,"+" Your taken Hour is: "+takenhour+"hr");
    }
    else

    System.out.println("This worker has to leave the company,"+" Your taken Hour is: "+takenhour+"hr");
    }

    }


    Also my Programme in Java

    ReplyDelete
  2. My new Libraray Programe========----


    public class LibraryDemo {

    public static void main(String[] args)
    {

    int days = 31;
    int late = days;

    if(days>=1 && days<=5)
    {
    System.out.println("Your fine is: 50 paisa because you are late "+late+" Days");
    }

    if(days>=6 && days<=10)
    {
    System.out.println("Your fine is: 1 Rs because you are late "+late+" Days");
    }

    if(days>=11 && days<=30)
    {
    System.out.println("Your fine is: 5 Rs because you are late "+late+" Days");
    }

    if(days>30)
    {
    System.out.println("Your membership cancled because you are late after 30 days and Your late days are "+late+" Days");
    }

    }
    }

    ReplyDelete
  3. Any character is entered through the keyboard, write a
    program to determine whether the character entered is a
    capital letter, a small case letter, a digit or a special symbol.
    The following table shows the range of ASCII values for
    various characters.
    Characters ASCII Values
    A – Z
    a – z
    0 – 9
    special symbols
    65 – 90
    97 – 122
    48 – 57
    0 - 47, 58 - 64, 91 - 96, 123 - 127




    ANS=========

    public class DemoPrint {

    public static void main(String[] args)
    {

    char ch = '7';
    int position= ch;
    if((ch>=0 && ch<=47) || (ch>=58 && ch<=64) ||(ch>=91 && ch<=96) || (ch>=123 && ch<=127))
    {
    System.out.print("Special Symbol: "+position);
    }

    if(ch>=48 && ch<=57)
    {
    System.out.print("Digit: "+position);
    }

    if(ch>=65 && ch<=90)
    {
    System.out.print("Capital: "+position);
    }

    if(ch>=97 && ch<=122)
    {
    System.out.print("Small: "+position);
    }

    }
    }

    ReplyDelete
  4. An Insurance company follows following rules to calculate
    premium.
    (1) If a person’s health is excellent and the person is between
    25 and 35 years of age and lives in a city and is a male
    then the premium is Rs. 4 per thousand and his policy
    amount cannot exceed Rs. 2 lakhs.
    (2) If a person satisfies all the above conditions except that
    the sex is female then the premium is Rs. 3 per thousand
    and her policy amount cannot exceed Rs. 1 lakh.
    (3) If a person’s health is poor and the person is between 25
    and 35 years of age and lives in a village and is a male then the premium is Rs. 6 per thousand and his policy
    cannot exceed Rs. 10,000.
    (4) In all other cases the person is not insured.
    Write a program to output whether the person should be
    insured or not, his/her premium rate and maximum amount
    for which he/she can be insured


    ANS===========-----

    public class Insurence {

    public static void main(String[] args)
    {
    int age = 25;
    int premamt ,policyamt;

    char loc = 'c';
    char sex = 'f';
    char health = 'g';


    if((age>=25 && age<=35)&&(health=='g')&&(loc=='c')&&(sex=='m'))
    {
    premamt = 4;
    policyamt = 2;
    System.out.println("Person is Insured"+"\nPayble Premium: "+premamt+" /Thousands"+"\nPolicy Ammount is: "+policyamt+" Lakh");
    }

    else if((age>=25 && age<=35)&&(health=='g')&&(loc=='c')&&(sex=='f'))
    {
    premamt = 3;
    policyamt = 1;

    System.out.println("Person is Insured"+"\nPayble Premium: "+premamt+" /Thousands"+"\nPolicy Ammount is: "+policyamt+" Lakh");
    }

    else if((age>=25 && age<=35)&&(health=='b')&&(loc=='v')&&(sex=='m'))
    {
    premamt = 6;
    policyamt = 10;

    System.out.println("Person is Insured"+"\nPayble Premium: "+premamt+" /Thousands"+"\nPolicy Ammount is: "+policyamt+" Thousands");
    }

    else
    System.out.println("Person is not Insured");
    }

    }

    ReplyDelete