In this video, two programs are discussed after taking input using BufferedReader class. The first program reads a date in dd/mm/yyyy format and counts the days till the read date. The second program reads two persons birth date in the dd/mm/yyyy format and displays the elder person.
Link to Lesson 12 - Operator precedence:
• Lesson 12-A Evaluating expressions- Operat...
Practice Exercise:
Lesson 76: Program using BufferedReader class //do while loop and menu
Write a menu program with the following options.
1. Deposit cash.
2. Withdraw cash
3. Check balance
Enter your option
Initialize minimum balance with 100. Allow the user to choose options by taking choice. If choice is ‘y’ continue running the program. Otherwise, stop the iteration.
Sample Input and Output:
Opening and minimum Balance is Rs. 100
1. Deposit cash
2. Withdraw cash
3. Check balance
n. to exit:
Enter your option: 1
How much cash do you want to deposit: 200
Total amount in the account = 300.0
Do you wish to continue (y/n): y
1. Deposit cash
2. Withdraw cash
3. Check balance
n. to exit:
Enter your option: 2
How much cash do you want to withdraw: 300
You cannot withdraw more than 200.0
Do you wish to continue (y/n): y
1. Deposit cash
2. Withdraw cash
3. Check balance: n. to exit:
Enter your option: 2
How much cash do you want to withdraw: 200
Amount in account after withdrawing: 100.0
Do you wish to continue (y/n): y
1. Deposit cash
2. Withdraw cash
3. Check balance
n. to exit:
Enter your option: 3
Balance in your account: 100.0
Do you wish to continue (y/n): n