aspose file tools
The moose likes Associate Certification (SCJA,OCAJ 5/6) and the fly likes Hey Can anyone help me with this Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Associate Certification (SCJA,OCAJ 5/6)
Reply Bookmark "Hey Can anyone help me with this" Watch "Hey Can anyone help me with this" New topic
Author

Hey Can anyone help me with this

Jed Chua
Greenhorn

Joined: Apr 17, 2011
Posts: 1
I need the simplest program possible )) thanks

i cant seem to make the right main method! and the exceptions. im still new to this.

PROBLEM

--------------------------------------------------------------------
1. Create a class named Account with the following data members
>name of type String
>balance of type double
>accountNo of type String
Encapsulate Fields and provide Setters and Getters for the data members.
Provide the following methods for the Account Class
>public void deposit(double amount)
- increases the balance by the amount
>public void withdraw(double amount)
- decreases the balance by the amount
Create a CreditCard class that inherits the Account class.
Provide a constructor for the CreditCard class that initializes the Name of the cardholder, account number, card number, credit_limit, credit balance, expiry_date, and balance. It is assumed that the cardholder initially does not have debts yet.
CreditCard class must contain the following data members: --
2 credit_limit of type double
3 credit_balance of type double
4 card_number of type long
5 expiry_date of type String
6 public void cashAdvance ( float amount )
- must throw ” ExceedsCashAdvanceLimitException “ if the amount exceeds 30% of the credit limit, otherwise the credit balance will increase by amount (if account balance is zero).
- must throw “InsufficientBalanceException” if the amount does not exceed 30% of the credit limit but will exceed the credit limit after the credit balance is increased by amount.
- charges a fixed additional amount of 300.00 for every cash advance made by the card owner.
7 public void deposit (float amount);
- decreases the credit balance by amount and if amount exceeds the credit balance then account balance increases by amount or maybe a fraction of the amount depending on the excess over credit balance.
8 public void balanceInquiry ();
- displays the credit limit and the credit balance.
9 public void swipe (float amount)
- must throw “InsufficientBalanceException” if credit balance, increased by amount, will exceed the credit limit.
Mala Gupta
Author
Ranch Hand

Joined: Sep 27, 2002
Posts: 196
    
    5
Jed,

If this is your project work, please complete it yourself. The bartenders are quite strict with such posts here!

cheers
Mala


Author of book OCA Java SE 7 Programmer I Certification Guide from Manning
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Hey Can anyone help me with this
 
Similar Threads
JUnit Testing Problem
JUnit Testing Problem
need help with code
JUnit Test Query
Basic Query in Spring