Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java a (Refer to class diagram 7-1.) Declare the Account class and its instance variables. Then, code a constructor that assigns default values to

In Java a (Refer to class diagram 7-1.) Declare the Account class and its instance variables. Then, code a constructor that assigns default values to these variables. The default value you assign to the customer variable should prevent a NullPointerException (hint: do not assign a default value of null to the customer variable). Write this code as concisely as possible.

Class diagram 7-1 image text in transcribed b. (Refer to class diagram 7-1.) Code a constructor for the Account class that assigns values to the instance variables based on the values that are passed to it. The parameters of this constructor should be given the same names as the instance variables. c. (Refer to class diagram 7-1.) Write the code for the getType method. This method should simply return the value of the type instance variable. d. (Refer to class diagram 7-1.) Write the code for the creditAccount and debitAccount methods. The creditAccount method should add the amount thats passed to it to the balance instance variable, and the debitAccount method should subtract the amount thats passed to it from the balance instance variable. e. (Refer to class diagram 7-1.) Code a statement that calls the getFormattedBalance method and stores the String object thats returned in a variable named formattedBalance. Assume that an Account object named account has already been created in the calling class.

in your answers plaease lable answer for a answer for b ect ect

Account uber: int -custarer: Custaner pe: String balance: double setNuber (int) tgetNurberO: int +setCustaner (custaner) tgetCustaner (int): Custamer +set ype(String) getType) String set Ballance(doublle) get Balance): doble tget FonattedBalance String getCusta): String creditAocount (doible)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Climate And Environmental Database Systems

Authors: Michael Lautenschlager ,Manfred Reinke

1st Edition

1461368332, 978-1461368335

More Books

Students also viewed these Databases questions

Question

Conduct an effective performance feedback session. page 360

Answered: 1 week ago