Course Code: DSC-C-BCA-233 P
Credits: 4
Course Outcomes:
On the completion of the course practically students will:
1. Understand the java programming and Object Oriented Programming concepts.
2. Understand the concepts of Interface, Exception handling, Multithreading, and Package.
Prerequisites:
Basic computer skills, such as saving files in multiple versions and formats.
Unit-1 1. Write a program to evaluate simple interest of a given
Java principle.
Introduction 2. A motor cycle dealer sells two-wheelers to his customer on
loan, which is to be repaid in 5 years. The dealer charges
simple interest for the whole term on the day of giving the
loan itself. The total amount is then divided by 60(months)
and is collected as equated monthly installment (EMI). Write
a program to calculate the EMI for a loan of Rs. X, where X is
given from command line argument. Print the EMI value in
rupees.
3. A car accessories shop assigns code 1 to seat covers, 2 to
steering wheel covers , 3 to car lighting and 4 for air purifiers.
All other items have code 5 or more.
While selling the goods, a sales tax of 2% to seat covers ,3%
to steering wheel covers, 4% to car lighting, 2.5% to air
purifiers and 1.2% for all other items is charged. A list
containing the product code and price is given for making a
bill. Write a java program using switch statements to prepare
a bill.
4. Write a java program to scan 3 integer values from the
command line argument and display the maximum number
using conditional operator.
5. Write a program to calculate the hypotenuse of right angled
triangle when other sides of the triangle are given.
(Hypotenuse = square root (x*x + Y *Y)).
6. Write a program to calculate the area of square and
rectangle by overloading the area method.
7. Create a complex number class. The class should have a
constructor and methods to add, subtract and multiply two
complex numbers and to return the real and imaginary parts.
8. A shop during festival season offers a discount 10% for
purchase made up to Rs.1,000,12% for purchase value of
Rs.1,000 or more up to Rs 1,500 and 15% for purchase value
of Rs.1,500 or more. Write a program to implement the
PROF.DEVRAJSINH JADAV 1
, above scheme for a given sales and print out the sales and
print out the sales value, discount and net amount payable
by a customer. Create necessary methods and constructors.
9. A bank gives 6.5% per annum interest on deposits made in
that bank. Write a program to calculate the total amount
that a person will receive after the end of 5 years for a
deposit of Rs.5000 for compound interest. Create necessary
methods and constructors too.
10. Write a java program to display powers of 2 i.e. 2,4,8,16 etc
up to 1024 using bitwise operators.
1. Write a program to evaluate simple interest of a given principle.
Input:
import java.util.Scanner;
public class SimpleInterestCalculator {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Input principle amount
System.out.print("Enter the principle amount: ");
double principle = scanner.nextDouble();
// Input rate of interest
System.out.print("Enter the rate of interest (in percentage): ");
double rate = scanner.nextDouble();
// Input time period in years
System.out.print("Enter the time period (in years): ");
double time = scanner.nextDouble();
// Calculate simple interest
double simpleInterest = (principle * rate * time) / 100;
// Display the simple interest
System.out.println("Simple Interest = " + simpleInterest);
scanner.close();
}
}
PROF.DEVRAJSINH JADAV 2