Professional Documents
Culture Documents
- Method that displays all details about a single instance of Computer in the
following
Format.
OR
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.
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.
OR
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
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