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

C10A4: (b) Design an application that declares two CheckingAccount objects and s

ID: 3764530 • Letter: C

Question

C10A4: (b) Design an application that declares two CheckingAccount objects and sets and displays their values. Write the pseudocode that defines the class from the class diagram & previous information provided by filling in the blanks.

Pseudocode:

start

   Declarations

      CheckingAccount account1

      CheckingAccount account2

   account1 = getAccountData()

   account2 = getAccountNum()

   display(account1)

   ----------(----------)

stop

CheckingAccount get---------- ()

   Declarations

      ---------- account

      string name

      num accountNum

      num ----------

   output “Enter your name ”

   input name

   output “Enter account number ”

   input number

   output “Enter balance ”

   input balance

   account.setName(name)

   -------.---------(------)

   ------.------ (------)

return account

void display(------------)

   output “-------- ----- -----”

   ------.------()

return

Class Diagram

CheckingAccount

-accountNum: num        

-name: string

-balance: num

+setAccountNum(number : num) : void

+setName(name : string) : void

+setBalance(bal : num) : void

+displayValues() : void

CheckingAccount

-accountNum: num        

-name: string

-balance: num

+setAccountNum(number : num) : void

+setName(name : string) : void

+setBalance(bal : num) : void

+displayValues() : void

Explanation / Answer

start

   Declarations

      CheckingAccount account1

      CheckingAccount account2

   account1 = getAccountData()

   account2 = getAccountNum()

Here is the pseudo code, hope it will help you

   display(account1)

display(account2)

stop

CheckingAccount getAccountData()

Declarations

CheckingAccount account

string name

num accoutnNum

num balance

output “Enter your name ”input name

output “Enter account number ”

input number

output “Enter balance ”

input balance

account.setName(name)

account.setAccountNum(number)

account.setBalance(balance)

return account

void display(CheckingAccount account)

output “Checking Account data”

account.displayValues()

return

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