Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"


Java Language Provide Four Different Types of Cases to write the name.





When you will write code then you should focus on the naming convention, it provides the ways to provide the name of Variable, Constant, package, Methods, Class, and Interface.



1 lower case:-  for a keyword, for variable, single name method

example

class, static, void, main these all are a keyword in java, it will be defined in lower case.

2 Proper Case or initial or Capitalize:-

Classname,Interfacename

3 Camel Case:-

the first word all char in lower case and the second word first char will be in caps and the same pattern will apply for all word.
The method name which contains more than two words will be in Camel case, of java should be declared in Camel Case.

toString()
indexOf()
lastIndexOf()

4 Upper case:-

Constant in Java should be declared in Upper Case.



ASSIGNMENT OF JAVA Program:-

1 WAP to create a Salary Calculator of an employee using basic, ta, da, comm, pf, number of leave.
   calculate net salary and gross salary
if the gross total salary is >50000 per year then income tax will be deduced as per income tax exemption.


basic:-20000
ta:-  2000
da:- 2500
comm:-  30000
pf:-  2000  (1000 emp and 1000comp)
leave:-


2)  WAP to calculate the addition of Complex number?

3)  WAP to calculate area of triangle using heron's formula in java?


4)  WAP to calculate age where the son is 20 years younger than the father and 18 years younger than the mother what will be the age of the son, father, and mother, calculation start year will be entered by the user?









next blogger.com/blog/post/edit/7768209714160124788/1813306666040951691



2 Comments

If you have any doubt in programming or join online classes then you can contact us by comment .

  1. import java.util.Scanner;
    class Salary
    {
    public static void main(String args[])
    {
    Scanner sc=new Scanner(System.in);
    int bs,ta,da,pf,leave,comm,net,gross,it;
    System.out.println("Enter basic salary");
    bs=sc.nextInt();
    System.out.println("Enter travelling allounce ");
    ta=sc.nextInt();
    System.out.println("Enter daily allounce");
    da=sc.nextInt();
    System.out.println("Enter Connmmission");
    comm=sc.nextInt();
    System.out.println("Enter no. of leave");
    leave=sc.nextInt();
    System.out.println("Enter amount of pf");
    pf=sc.nextInt();
    gross=bs+ta+da+comm;
    System.out.println("n\n\n\n\n\nGross salary is ="+gross);
    net=gross-pf-(leave*200);
    System.out.println("Net salary ="+net);
    int total=12*net;
    System.out.println("Total salary per year ="+total);
    if(total<=250000)
    System.out.println("NO INCOME TAX");
    else if(total<500000)
    {

    total=total-250000;
    it=(int)(total*.05);
    System.out.println("Income Tax to be payed ="+it);
    }
    else if(total<=1000000)
    {

    total=total-250000;
    it=(int)(total*.2);
    System.out.println("Income Tax to be payed ="+it);

    }
    else if(total>1000000)
    {

    total=total-250000;
    it=(int)(total*.3);
    System.out.println("Income Tax to be payed ="+it);
    }

    }

    }

    ReplyDelete
  2. class Salary
    {
    public static void main(String args[])
    {
    int base=20000, ta=2000, da=2500,comm=30000,pf=2000, leave=2;
    int net, gross, l;
    gross=base+ta+da+comm;
    l=(gross/30)*leave;
    net=gross-pf-l;
    System.out.println("Gross Salary is: " +gross);
    System.out.println("Net Salary is: " +net);
    }
    }

    ReplyDelete

Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post