Java with BlueJ in Hindi Class X part 1

preview_player
Показать описание
Learn Java with BlueJ IDE for Class 10th - Part 1
Syllabus according to Class X of ICSE
Revision
Рекомендации по теме
Комментарии
Автор

/**
* Difference - Write a program to input principal, rate and time.
* Calculate and display the difference between
* Simple interest SI and Compound interest CI by using function argument.
*/

public class Difference
{
public static void main(int p, int r, int t)
{
double si, ci=0, amt, diff=0;
si = p*r*t/100.0;
amt = p*(Math.pow(1+r/100.0, t));
ci = amt-p;
diff = ci-si;
System.out.println("The compound interest = Rs. " + (float)ci);
System.out.println("The Simple Interest = Rs. " + si);
System.out.println("The difference between CI and SI = Rs. " + (float)diff);
}
}

ComproliveHindichannel
Автор

/**
* Evaluate - Write a program in Java to find the value of the given expression
* p=(a*a+b*b)/(a-b)
*/
public class Evaluate
{
public static void main(String args[])
{
int a, b;
double p;
a = Integer.parseInt(args[0]);
b = Integer.parseInt(args[1]);
p = (double)(a*a+b*b)/(a-b);
System.out.println("The value of the expression is = " + p);
}
}

ComproliveHindichannel
Автор

/**
* Salary - Write a class with name of Employee and basic pay
* as its data member. Find the gross pay of an employee
* for the following allowances and deductions.
* Darness allowance = 25% of basic pay
* Home Rent allowance = 15% of basic pay
* Provident Fund = 8.33% of basic pay
* Net Pay = Basic Pay + DA + HRA;
* Gross Pay = Net Pay + Dearness Allowance + House Rent Allowance
*/

import java.util.*;
public class Salary
{
public static void main (String args[])
{
Scanner x = new Scanner(System.in);
System.out.println("Enter employee's name and basic salary");
double basic, da, hra, pf, gp=0, np=0;
String employee_name;
employee_name = x.nextLine();
basic = x.nextInt();
da = basic * 25.0/100;
hra = basic * 15.0/100.0;
pf = basic*8.33/100.0;
gp = basic + da + hra;
np = gp - pf;

System.out.println("Name of the employee = " + employee_name);
System.out.println("Gross Pay = Rs." + gp);
System.out.println("Net Pay = Rs. " + np);
}
}

ComproliveHindichannel
Автор

/**
* Roll - Find out the percentage of boys and girls present in a class
*/

import java.io.*;
public class Roll
{
public static void main (String args[]) throws IOException
{
int a, b, x, y;
float m, n;
InputStreamReader read = new
BufferedReader in = new BufferedReader(read);
System.out.println("Enter the number of girl students and boys students in the class");
a =
b =
System.out.println("Enter the number of absent girls and boys in a class");
x =
y =
m = (float)(a-x)/(a+b)*100;
n = (float)(b-y)/(a+b)*100;
of girl students present in the class = " + m );
of boys students present in the class = " + n);
}
}

ComproliveHindichannel