BCA Sem 3 - Core Java Practical Solutions
Program 1: Simple Interest
public class SimpleInterest {
public static void main(String[] args) {
double principal = 10000;
double rate = 5;
double time = 2;
double simpleInterest = (principal * rate * time) / 100;
[Link]("Simple Interest = Rs. " + simpleInterest);
}
}
BCA Sem 3 - Core Java Practical Solutions
Program 2: EMI Calculation
public class LoanEMI {
public static void main(String[] args) {
double principal = [Link](args[0]);
double rate = 10;
int time = 5;
double simpleInterest = (principal * rate * time) / 100;
double totalAmount = principal + simpleInterest;
double emi = totalAmount / 60;
[Link]("Monthly EMI = Rs. %.2f\n", emi);
}
}
BCA Sem 3 - Core Java Practical Solutions
Program 3: Accessories Billing with Switch
import [Link];
public class CarAccessoriesBill {
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
int code = [Link]();
double price = [Link]();
double tax = 0;
switch (code) {
case 1: tax = 0.02; break;
case 2: tax = 0.03; break;
case 3: tax = 0.04; break;
case 4: tax = 0.025; break;
default: tax = 0.012; break;
}
double taxAmount = price * tax;
double total = price + taxAmount;
[Link]("Total bill amount: Rs. %.2f\n", total);
}
}