You are on page 1of 4

Exam Project Work

Java Programming Language

1. Students must attempt Total 2 projects.


2. One project from 1A OR 1B. And One more Project from 2A OR 2B.
3. All Projects carry equal marks i.e. 50
4. Source Code should be send in .txt file
5. Output / Screen Shot should be sent in .jpeg file
6. Please send exam project on pgdit3@scdl.net, in soft copy only.
7. No Hard Copy of the exam project will be accepted.

/* Project Question No. 1A:


Create a class Computer that stores information about different types of Computers
available with the dealer. The information to be stored about a single computer is,
- Company Name
- RAM size.
- Hard Disk Capacity.
- Processor Speed.
- Processor Make.
- Price .
- Quantity of the Computers.

This class contains following methods,


- Constructor method that assigns user input values to above
mentioned variables.

- main ( ) method that creates array of 4 objects of Computer


class and that takes input for all above details from the user and
calls method to check validity of Quantity and Price values.
If all values are valid then create the objects and display the details
for all 4 toys.

- Method that checks validity of quantity and price.


If the quantity is 0 or negative then method should throw user defined
exception with appropriate message and come out of program.
Similarly if the price is 0 or negative then it should throw user defined
exception with appropriate message and come out of program.

- Method that displays all details about a single instance of Computer in the
following
Format.

Computer Name : IBM


RAM Size : 512 MB
Processor Make : Intel
Processor speed : 300
Quantity : 50
Total Price of Computers : 150,0000/-
*/
End of Question no. 1A

OR

Project Question No. 1B


Assume that the bank maintains two kinds of accounts for its customers, one called savings
account and the other current account. The savings account provides compound interest and
withdrawal facilities but no cheque book facility. The current Account provides cheque book
facility but no interest .Current account should also maintain a minimum balance and if the
balance falls below this level, a service charge is imposed.

In this program student is expected to create 3 classes as described below.

1. Account Class : This is an abstract class. It contains following information,

- Customer Account number an integer number,


This is automatically generated starting from 101.
- Customer type which is of character type and can have
only 2 values C or S. C for Curr-acct and S for Savings account
- Customer Name.
- Customer Address of String type.

This class has following methods,


- Constructor method to initialize all 4 variables given above
- One method that displays all above information in required
output format.
- One abstract method defined as,
float calculates Balance ( );
This method is overridden in the two subclasses.

2. Curr-accnt class : This is one subclass of above defined Account class and stores
following information,
- Balance in Account.
- Interest Rate.
- Penalty.
This class contains following methods,
- Constructor.
- Overridden method calculate Balance to calculate the
balance in account.
- Accept deposit from customer and update the balance.
- Compute and deposit interest.
- Withdraw and update interest.
- Check for minimum balance, impose penalty if necessary
and update the balance.
- Method that displays the data in this class and super
class in the required output format.
3. Savings-accnt class This is one subclass of above defined Account class and
stores following information,
- Balance in Account.
- Interest Rate.
This class contains following methods,
- Constructor.
- Overridden method calculate Balance to calculate the
balance in account.
- Accept deposit from customer and update the balance.
- Compute and deposit interest.
- Withdraw and update interest.
- Method that displays the data in this class and super
class in the required output format.

At the end, this program should ask the user to enter the customer account number
and should find out whether the particular account number is valid or not. If the customer is
present then the all the information about the concerned account should be displayed .
Similarly, the customer is asked whether the customer wants to deposit or withdraw the
amount and accordingly proper methods are invoked.

If the customer account number is not valid then proper error message should be displayed.

End of Question no. 1B

Project Question No. 2A

Write a Java program to create simple Calculator for 4 basic Math operations,
Addition, Subtraction, Multiplication and Division.
The calculator should simulate the look of handheld calculator containing the following:
1. One textbox for displaying the input as well as output value.
2. Buttons for representing numbers from 0 to 9.
3. Buttons for representing mathematical operations .
Use suitable additional Swing components if required. Write proper code for making this
calculator operational. Students are expected to handle the related events like button click.

End of Question 2A.

OR

Project Question No. 2B :

Create 2 Thread classes.One Thread is Incrementor and has one variable cnt1 with initial
Value 0. Incrementor threads increments value of cnt1 by 1 each time.
The other thread is Decrementor which has variable cnt2 with initial value 100.
Decrementor threads decrements value of cnt2 by 1 each time.

- Incrementor thread increments value of cnt1 by one and notifies the other thread
about this value
- The decrementor threads decrements value of its variable cnt2 by one and compares
values of cnt1 and cnt2. If values of cnt1 and cnt2 are different then notifies the
Incrementor thread and above mentioned step is repeated.
- But if values of cnt1 and cnt2 are matching then following message is displayed

Matching Value : 50

- Now Decremented thread sets a flag as true and notifies the other thread and stops
its execution.
- As flag is set to true, Increment or thread understands that matching has occurred
and stops its execution

NOTE : In this example use of wait ( ) , notify ( ) and synchronize statements is


Expected.

End of Question 2B

Please note that the project will be evaluated on the following criteria:

1. Program Logic
2. Code Documentation
3. Correctness/Completion