Design a class named CheckingAccount that holds a checking account number name

Design a class named checkingaccount that holds a

This preview shows page 3 - 7 out of 15 pages.

5.Design a class named CheckingAccountthat holds a checking account number, name of account holder, and balance. Include methods to set values for each data fieldand a method that displays all the account information. Create the class diagram and write the pseudocode that defines the class.
Programming Logic and Design, 7e Solutions 10-4 -balance: num +setAccountNum(number : num) : void +setName(name : string) : void +setBalance(bal : num) : void +displayValues() : void Pseudocode: class CheckingAccount Declarations private num accountNum private string name private num balance public void setAccountNum(num number) accountNum = number return public void setName(string name) this.name = name return public void setBalance(num bal) balance = bal return public void displayValues() output “Account number: ”, accountNum output “Name: ”, name output “Balance: ”, balance return endClass 6.Complete the following tasks: a. Design a class named StockTransactionthat holds a stock symbol (typically one to four characters), stock name, and price per share. Include methods to set and get the values for each data field. Create the class diagram and write the pseudocode that defines the class.
Programming Logic and Design, 7e b. Design an application that declares two StockTransactionobjects and sets and displays their values.
Programming Logic and Design, 7e Solutions 10-6 Declarations StockTransaction trans string stockSym string name num price output “Enter stock symbol ” input stockSym output “Enter stock name ” input name output “Enter price ” input price trans.setStockSymbol(stockSym) trans.setStockName(name) trans.setPricePerShare(price) return trans void display(StockTransaction trans) output “Stock Transaction data” output “Stock symbol: ”, trans.getStockSymbol() output “Name: ”, trans.getStockName() output “Price: ”, trans.getPricePerShare() return

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture