Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Java Assignment I need help with design a java class. This material is somewhat

ID: 3911007 • Letter: J

Question

Java Assignment

I need help with design a java class.

This material is somewhat more theoretical than that of previous topics, so instead of writing a program for this assignment, you are going to work on a design. Specifically, your task is to design a class to represent a credit card. Try to design your class such that it only includes fields and methods relative to a credit card itself, without branching out into related functionality, like that of a bank or a consumer. At the same time, try to make your class as complete as possible, so that it can be used in any application that involves a credit card. To complete this assignment, you will turn in a text document (Word or PDF) with the following information: • A list of the fields and methods of your class. For fields you will need to specify the type, the accessibility (private, public, etc), whether it is a static or instance field, and any limitations on the values (non-negative, always less than some other value, etc). For the methods, you will need to supply the return type and parameter type list. • A free-form description of what each field and method is meant to do, with explanation of any potentially confusing design decisions.

This is what I have so far. No code is needed for this.

Public class CreditCard
   Members:
       Private String name
       Private String password
       Private Date date_of_issue
       Private Date date_of_expiry
       Private Double balance
       Private static final Double creditLimit = 5000; // for 5000Dollars
       Private Double TransactionLimit;
       private Boolean isActive;
      
   constructor
       CreditCard(Name, Password, balance, TransactionLimit)
           //set card to active, set the name, password, balance and transactionLimit
           //set date_of_issue to today and date_of_expiry to 10 years later
          
      
   Methods
       public debit(password, amount)
           //Debit the amount, if password matches and balance is greater than the amount to be //withdrawn
       public credit(amount)
           //Credit the amount, sum the amount to balance

public getNameOnCard()
           //return name of the card holder
       public isCardWorking()
           //return if date_of_expiry is after today's date and if card is in active state
       public getBalance()
           //return the balance
       public getCreditLimit()
           //return the creditLimit
       public getTransactionLimit()
           //return the transactionLimit
       public isActive()
           //return true is card is active
          
      
       public setName(name)
           //set card holder name
       public setPassword(pass)
           //set password for the card

Explanation / Answer

Fields used are:-

Methods are:-

Please let me know in case of any clarifications required. Thanks!

Field Name Type Accessibility Static/Instance Value limitation Purpose name String Private Instance alphanumeric less than 50 chars Store the name of the customer password String Private Instance should be 10 chars atleast with one Caps, one special character (_, @, #, $, etc) Stores Customer Password date_of_issue Date Private Instance Cannot be future Date When the card was issued date_of_expiry Date Private Instance Cannot be Past Date When card will expire balance Double Private Instance Cannot be negative Stores balance amount creditLimit Double Private Static Value is fixed and cannot be changed Stores the Credit Limit of the Card TransactionLimit Double Private Instance Cannot be greater than balance available Stores the transaction max amount isActive Boolean Private Instance Should be only true/false Check if the Credit Card is Active.
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote