computer project

77
INDEX PART:I Function Overloading 1. 2. 3. 4. 5. PART :II Methods and Functions 1. 2. 3. 4. 5. PART :III Arrays in decision making 1. 2. 3. 4. 5. PART :IV Concept of Arrays 1.

Upload: darshan-kumar

Post on 09-Nov-2015

5 views

Category:

Documents


0 download

DESCRIPTION

Blue J java programs for class X.32 programs

TRANSCRIPT

INDEXPART:IFunction Overloading1.2.3.4.5.PART :IIMethods and Functions1.2.3.4.5.PART :IIIArrays in decision making1.2.3.4.5.PART :IVConcept of Arrays1.2.3.4.5.

PART :VMenu driven programs1.2.3.4.5.PART :VIPrinting patterns1.2.3.4.5.PART :VIILibrary classes1.2.3.4.5.

Program1 : Write a program to represent Bank Account. Include the following members :Data Members1. Name of The Depositor1. Type of Account1. Account number1. Balance Amount in the account Methods1. To assign initial values1. To Withdraw an amount after checking Balance1. To display the name and balance1. To deposit an amount1. Do write proper constructor functions

package Constructors;class BankAccount {private String DepositorName;private long AccountNumber;private String AccountType;private double BalanceAmount;publicBankAccount() {DepositorName=" ";AccountNumber =0; AccountType = " ";BalanceAmount= -1;}publicBankAccount(String dName, long accno, String accType, double balAmount){DepositorName=dName;AccountNumber =accno; AccountType = accType;BalanceAmount= balAmount;}public void initialise (String dName, long accno, String accType,doublebalAmount){DepositorName=dName;AccountNumber =accno; AccountType = accType;BalanceAmount= balAmount;}public void display(){System.out.println("Depositor name : " +DepositorName);System.out.println("Account Number : " +AccountNumber);System.out.println("Account Type : " +AccountType);System.out.println(" Balance Amount :" +BalanceAmount);}public void deposit(double amount){BalanceAmount += amount;}public void withdraw(double amount){if(amount